[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua dynamic libraries
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 20 Jun 2014 11:32:44 -0300
> Sometimes I get the error of duplicate virtual machine.
For Linux and Mac OS X, just don't list the Lua library (-llua or liblua.a)
when creating the dynamic library.
# Linux
gcc -shared -o foo.so foo.o bar.o
# Mac OS X
gcc -bundle -undefined dynamic_lookup -o foo.so foo.o bar.o
Add the Lua library statically in your app. Make sure your app exports
the Lua API symbols. In Linux, you have to use -Wl,-E when linking it.
The instructions for Windows are different: you need a Lua DLL and you
don't link Lua statically in your app.
See also http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/install.html .