lua-users home
lua-l archive

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


On 15/09/2011, at 2:52 PM, Diab Jerius wrote:

> This code is so simple I must be doing something obviously wrong. Would
> someone please point out my error?

I'm not sure I can point out the right error, but
 - I don't think you need to link against liblua for either platform (and a possible problem is your module getting linked to two separate copies of Lua)
 - for OS X, you'll need to link with -undefined dynamic_lookup
 - I don't think you need -ldl any more on OS X (What version is it?)
 - I think you can use -fPIC on OS X

> ifeq ($(plat),linux)
> 
> ifc.so : ifc.o
>        gcc -shared  -fPIC -DPIC $< -o $@
> 
> endif
> 
> ifeq ($(plat),macos)
> 
> ifc.so : ifc.o
>        gcc -bundle -undefined dynamic_lookup -fPIC $< -o $@ 
> 
> endif