[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Mac OS X dynamic loading and Lua5.0.2
- From: Peter Colson <pcolson@...>
- Date: Wed, 23 Mar 2005 14:17:28 +1100
Fantastic! It's all working now. I'll commit these details to memory...
Thanks for your help (and others too). This is a good list for getting
prompt, useful replies.
On 23/03/2005, at 1:38 PM, Mike Pall wrote:
Peter Colson wrote:
gcc -o lua lua.o -L. -llua -llualib -lm -ldl -Wl,-E
fails with OS X ld not supporting the '-E' flag.
Just comment out the whole "DL= ..." line in src/Makefile for OSX.
Since Lua 5.1 uses the native dynamic library functions, -ldl is
not required. Symbols are exported by default on OSX. But do not
use 'strip' on the executable ('strip -x' is ok, though).
With Lua 5.1 you should use require("xyz") and put the module into
proper path ( /usr/local/lib/lua/5.1/xyz.so ).
Under OS X is the extension typically ',dylib' or '.so' or doesn't it
It doesn't matter and Lua uses '.so' for consistency with other
POSIX machines (other ported apps do that, too).
ld: flag: -undefined dynamic_lookup can't be used with
MACOSX_DEPLOYMENT_TARGET environment variable set to: 10.1
gcc -O2 -fno-common -c -o module.o module.c
gcc -bundle -undefined dynamic_lookup -o module.so module.o