I come from more of a Python and CTYPES background...and am trying to work out the best way to call a standard C shared lib from Lua script.
I have heard of "Alien" (http://alien.luaforge.net/), but am not sure how current it is? Meaning it is updated regulary?
For example, I know that thier is an SQLite Lua library but let's say I wanted to call the SQLite shared lib that is created when I compile SQLIte?
So for example: In my case the lib is in /usr/local/lib/libsqlite3.so
If I write a little dummy script just to see if it can load the lib
require "libsqlite3"
print "hello"
I get the following error:
debian@debian:~/Desktop/SQLite Test$ lua sqlite_test.lua
lua: error loading module 'libsqlite3' from file '/usr/local/lib/lua/5.2/libsqlite3.so':
/usr/local/lib/lua/5.2/libsqlite3.so: undefined symbol: luaopen_libsqlite3
stack traceback:
[C]: in ?
[C]: in function 'require'
sqlite_test.lua:1: in main chunk
[C]: in ?
debian@debian:~/Desktop/SQLite Test$
Does this mean that Lua cannot call shared libs "out the box" and that I HAVE TO use something like Alien?
I know I can also code the shared lib in such a way that it includes the Lua header files and I can make "Lua functions"...I was just hoping I could call shared libs that are "standard" on the box.
And help or advise would be greatly appreciated ;-)
Thanks
Lynton