lua-users home
lua-l archive

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

> 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.o bar.o

# Mac OS X
gcc -bundle -undefined dynamic_lookup -o 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 .