lua-users home
lua-l archive

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


I finally realized that the answer was not in lua conf, but in adding
-DLUA_USE_MACOSX to my "other C flags setting" (I'm doing the
compilation in Xcode).  When I tried to load a lib, I get this crash
log:

Link (dyld) error:

Symbol not found: _luaL_openlib
 Referenced from: /usr/local/lib/lua/5.1/mylib.so
 Expected in: dynamic lookup

Doing nm on the lib, I see

00000eb0 t __dyld_func_lookup
00000000 t __mh_bundle_header
        U _cos
00000ed0 t _l_cos
        U _luaL_openlib
        U _lua_pushnumber
        U _lua_tonumber
00000f10 T _luaopen_mylib
0000100c s _mylib
00001000 d dyld__mh_bundle_header
00001008 s dyld_func_lookup_pointer
00001004 s dyld_lazy_symbol_binding_entry_point
00000e80 t dyld_stub_binding_helper

The Lua library symbols are U (undefined) which I'd expect because the
module was compiled dynamically against liblua.a.  To give some
context, I'm building a Lua plugin to a software environment.  The
plugin has the Lua source compiled directly into it, so it contains
all of the symbols like "0001428c T _luaL_openlib".  Is there a way to
direct the lookup of this symbol into the binary of my external as
opposed to dyld crash because it can't find it in the mylib.so file?

thanks,
wes