Loading a C (binary) module
Posted: Sun Jan 24, 2016 6:06 pm
Hello,
After some years, I am using LÖVE again. I forgot how nice it was to use it! :-)
I am currently trying to load a binary Lua module (one of those written in C, compiled to a dynamic library). A thread from 2014 suggests that this is possible, but I am not being able to make it work.
When I require the module I get this:
Error: error loading module 'luasql.sqlite3' from file './luasql/sqlite3.so':
./luasql/sqlite3.so: undefined symbol: luaL_setfuncs
Apparently, the module is trying to register its functions with LÖVE's Lua state, which does not seem to provide the luaL_setfuncs function (which exists in my regular lua executable).
So, is loading of binary Lua modules in LÖVE supported? I am doing something wrong?
For completeness: I am using LÖVE 0.10.0 under 64-bit Linux (the standard LÖVE package provided by ArchLinux), but I'd be interested in running my program in other platforms (with the binary module compiled for each of them, obviously). The module I am trying to load is the SQLite3 driver of LuaSQL.
Thank you,
LMB
After some years, I am using LÖVE again. I forgot how nice it was to use it! :-)
I am currently trying to load a binary Lua module (one of those written in C, compiled to a dynamic library). A thread from 2014 suggests that this is possible, but I am not being able to make it work.
When I require the module I get this:
Error: error loading module 'luasql.sqlite3' from file './luasql/sqlite3.so':
./luasql/sqlite3.so: undefined symbol: luaL_setfuncs
Apparently, the module is trying to register its functions with LÖVE's Lua state, which does not seem to provide the luaL_setfuncs function (which exists in my regular lua executable).
So, is loading of binary Lua modules in LÖVE supported? I am doing something wrong?
For completeness: I am using LÖVE 0.10.0 under 64-bit Linux (the standard LÖVE package provided by ArchLinux), but I'd be interested in running my program in other platforms (with the binary module compiled for each of them, obviously). The module I am trying to load is the SQLite3 driver of LuaSQL.
Thank you,
LMB