lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



Ok, so I then pull the latest luasql source, and examining the make it
appears to want compat-5.1.  So I pull that also, and after messing with
the config directories a bit, get it to compile.  I also run 'make
install' after editing the config thusly (attempting to use lua 5.1):


compat is needed to use lua50 with the behavior of lua51. compat is not
to be used with lua51.

If I edit the luasql Makefile to remove the compat-5.1 object file from OBJS, and rebuild, I get the following runtime error when executing the test.lua under lua 5.1.1:

lua: error loading module 'luasql.mysql' from file '/usr/local/lib/lua/5.1/luasql/mysql.so': /usr/local/lib/lua/5.1/luasql/mysql.so: undefined symbol: luaL_module
stack traceback:
        [C]: ?
        [C]: in function 'require'
        test.lua:599: in main chunk
        [C]: ?

Speculation:

I'm guessing that the undefined symbol is defined in the 5.1 version of liblua, and it is not in 5.0 (but is provided via the compat-5.1 library). When I run lua as above, I am running the 5.1.1 version I built - and it was statically linked to liblua.a. I don't really understand how mysql.so is meant to dynmically link to whatever library contains luaL_module - how is that library specified? The makefile only gives a LIB_OPTION of "-shared". It doesn't specify liblua.so, for example, anywhere.

A further source of confusion to my win32 trained brain: why is the undefined symbol not caught at compile time? Is there no equivalent of "import libraries" that one can link against to ensure symbols we're expecting to find in a shared library are in fact available? (and that tell us which shared libraries to load on execution)

Finally, what tool can I use to look at which shared libraries a program has opened (and where they were loaded from?)


thanks for all help,
thomas




--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/