lua-users home
lua-l archive

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


> You shouldn't link to Lua in your runtime, but instead have it look for Lua symbols in the global namespace, that way no matter how the executable gets Lua (static link, dynamic, luajit) it gets the necessary symbols.
 
If I do not use -llua flag for test.so, I get "undefined symbols" error. Can you please show me how to produce standalone test.so, given default (static) Lua installation and original test.c?
-- Artur
$ cc -shared -o test.so test.c
Undefined symbols:
  "_luaL_setfuncs", referenced from:
      _luaopen_test in cccaB2Zl.o
  "_lua_createtable", referenced from:
      _fn_func in cccaB2Zl.o
      _luaopen_test in cccaB2Zl.o
ld: symbol(s) not found
collect2: ld returned 1 exit status