lua-users home
lua-l archive

Re: Dynamic library access/linking problem

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


Did you link your embedding program statically? Could be an explanation ...

Graham Henstridge wrote: [
Running the standard lua interpreter with require"socket.unix" works just fine.

Where could I have gone wrong? My pertinent(?) C code is:
if ( (L = lua_newstate()) ) {
...// open the libraries then ...
status = luaL_loadfile( L, /etc/capgo/process.lua );
...
status = lua_pcall(L, 0, LUA_MULTRET, 0);

Which fails with status = LUA_ERRRUN when process.lua attempts to load a C library with:
require "socket.unix"

Which bombs with:
"error loading module 'socket.unix' from file '/urs/lib/socket/unix.so':
/urs/lib/socket/unix.so: undefined symbol: lua_insert

So the question is, how can "undefined symbol" come about in my program but not in lua.c, when both are built against the same static lualib.a?

Help greatly appreciated.

Graham Henstridge
Email: graham@capgo.com




AltStyle によって変換されたページ (->オリジナル) /