When run:
kuyu@ub16:~/dkuyu/Dropbox/practice/lua/luabind/operator_other$ cat test.lua
package.loadlib('./testclass.so', 'init')()
a = testclass(5)
b = testclass(9)
c = a + b
a:print()
b:print()
c:print()
kuyu@ub16:~/dkuyu/Dropbox/practice/lua/luabind/operator_other$ 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/operator_other$ ./commands.bash
5
9
14
kuyu@ub16:~/dkuyu/Dropbox/practice/lua/luabind/operator_other$
No comments:
Post a Comment