lua-users home
lua-l archive

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



Hi,

I'm new to the list, though I've searched the archives and not found anything that seems to solve my problem.

I'm trying to build a module on OSX to use in an embedded Lua engine. I.E. I have an application that includes the Lua engine.

I'm using Lua 5.1.4. (Things work find under Windows, but I'm still a bit green on OSX).

I've tried compiling my library with various combinations of the options found at:

http://lua-users.org/wiki/BuildingModules

The module builds sucessfully, but when I try to import it into Lua using a require() my app crashes with:

[Session started at 2009-04-01 14:18:37 -0500.]
dyld: lazy symbol binding failed: Symbol not found: _luaL_newmetatable
  Referenced from: /Users/starkey/template.so
  Expected in: dynamic lookup

dyld: Symbol not found: _luaL_newmetatable
  Referenced from: /Users/starkey/template.so
  Expected in: dynamic lookup

From what I understand, my library should not contain the actual Lua code, so at link time it's looking back to my application to find it, and there it seems to be failing.

I know that the Lua environment is working OK within my application, so either there's some mangling of names going on somewhere, or I'm missing some settings in XCode.

Currently I have:

Mach-O Type: Bundle
Perform Single-Object Prelink: [x]
Other Linker Flags: -undefined dynamic_lookup -bind_at_load

I'm finding a lot of conflicting information since I guess things changed between 5.1.2 and 5.1.3, so I'm pretty confused at this point.

What am I doing wrong? Is it a configuration issue for the host app, or the library?

--
adam starkey