lua-users home
lua-l archive

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


Le mar 26/12/2006 à 22:25 Rici Lake à écrit:
> 
> On 26-Dec-06, at 9:40 PM, Mildred wrote:
> 
> > My compilation commands :
> >
> > $ g++ -g -shared luamod.cpp -llua -lm -o luamod.so
> > $ gcc -g testlua.c -ldl -llua -lm -o testlua
> 
> My guess is that you're ending up with two instances of liblua. That 
> won't work.
> 
> You don't mention whether liblua is liblua.so or liblua.a, but
> assuming the latter, I think you need to use the following:
> 
> g++ -g -shared luamod.cpp -o luamod.so
> gcc -g testlua.c -Wl,-E -ldl -llua -lm -o testlua
> 
> -Wl,-E passes the -E flag (--export-dynamic) to the linker, which
> makes symbols in the executable visible to dlopen'd shared objects.
> 
> 

Thanks a lot. I thought about it but I didn't knew that is was possible
to export symbols that way. But I thought liblua was required for the
module and the linker would complain about symbols not found. But that
is not the case.
Thank you again for this quick answer. I'll see if it compiles.

Mildred

-- 
Mildred       <xmpp:mildred@jabber.fr> <http://mildred632.free.fr/>
Clef GPG :    <hkp://pgp.mit.edu> ou <http://mildred632.free.fr/gpg_key>
Fingerprint : 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 [9A7D 2E2B]