Thursday, February 9, 2017

Luabind: properties demonstration

Consider the following code:

When run:

kuyu@ub16:~/dkuyu/Dropbox/practice/lua/luabind/properties$ cat commands.bash 
#!/bin/bash
g++ testclass.cpp -I/usr/include/lua5.2/ -c -fPIC
g++ -shared -Wl,--whole-archive -o testclass.so testclass.o -lluabind -Wl,--no-whole-archive
lua test.lua
kuyu@ub16:~/dkuyu/Dropbox/practice/lua/luabind/properties$ ./commands.bash 
7
89
5
lua: property 'b' is read only
stack traceback:
[C]: in function '__newindex'
test.lua:7: in main chunk
[C]: in ?
kuyu@ub16:~/dkuyu/Dropbox/practice/lua/luabind/properties$ 

No comments:

Post a Comment