lua-users home
lua-l archive

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

10.01.2012, 04:00, "Ignacio Burgueño" <>:
2012/1/9 Artur Galyamov <>

If I do main() && luaL_newstate() && luaopen_test() && luaL_dostring() in test.c, it's all ok.
It seems that problem is in itself… Is my build process okay?

$ cc test.c -shared -o -llua -lm

I think that is the problem. You shouldn't link with -llua in your .so.
I just look at how /usr/local/bin/lua is built:
gcc -o lua   lua.o liblua.a -lm -lreadline
I should not mix static and dynamic linking, right?
How do I then `require` external libraries with default Lua installation?  
Should I compile lua* to use
-- Artur