When run:
kuyu@ub16:~/dkuyu/Dropbox/practice/lua/luabind/register_free$ cat test.lua
package.loadlib('./register_free.so', 'init')()
x = A(3)
print(x:plus(5))
kuyu@ub16:~/dkuyu/Dropbox/practice/lua/luabind/register_free$ cat commands.bash
#!/bin/bash
g++ register_free.cpp -I/usr/include/lua5.2/ -c -fPIC
g++ -shared -Wl,--whole-archive -o register_free.so register_free.o -lluabind -Wl,--no-whole-archive
lua test.lua
kuyu@ub16:~/dkuyu/Dropbox/practice/lua/luabind/register_free$ ./commands.bash
8
kuyu@ub16:~/dkuyu/Dropbox/practice/lua/luabind/register_free$
No comments:
Post a Comment