lua-users home
lua-l archive

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


I've tried a couple of methods of importing Lua. Firstly I put all the
source into a folder called LuaSource and imported it. When I try to
compile it gives this error:
http://mcalley.net.au/luaErrors/Direct_code_import_error.png

The error message says main() occurred multiple times while it shouldn't have. This makes sense considering you've tried to compile 1) your program, 2) the Lua interpreter and 3) the Lua bytecode compiler all at once (they all have a main() function). If you take a look at lua-5.1.3/src/Makefile you'll see that you need different source code files for the Lua library vs. the interpreter vs. the compiler. So just pick the source code files needed to compile the library and import those but leave the other files out (at least lua.c and luac.c).

HTH and good luck,

Peter Odding