Hello,
My goal is to be able to run a completely lua based web server from an OpenWRT based device, and I thought Xavante would be my best bet of achieving this.
The problem is, I am also at the same time learning the basics of Lua and how to call it from C code and whatnot, and have been fighting with stuff that still does not involve embedded development at all, such as simply calling my Xavante config lua script (same as the example in their website).
I know Xavante has dependencies with 3 other modules (namely LuaSocket, Copas, LuaFileHandler), and I have been getting dynamic libraries linking problems even while trying to run it on my machine, not even on target yet.
I'm currently trying (from my "helloWorld.c" test file):
luaL_loadfile(L, "xavante.lua");
lua_pcall(L, 0, 0, 0);
where xavante.lua configures and starts xavante. From this command, I get dynamic linking problems, and it prints:
lua call error: error loading module 'lfs' from file '/usr/local/lib/lua/5.3/lfs.so':
/usr/local/lib/lua/5.3/lfs.so: undefined symbol: lua_gettop
Xavante starts normally if I just run:
Am I taking the right approach for dealing with this? Should I pre-compile the dynamic libraries and put them as .so files in my device, or should I find a way to link them statically? Is there another way to load dynamic libraries from .c files?
I've ran out of resources to solve this, so thank you very much, in advance, for any help,
Regards,
Daniel