Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling Lua 5.2 alpha under VS2010

I'd like to compile Lua 5.2 alpha under visual studio but I'm getting errors and I have no clue how to fix them.

error LNK1169: one or more multiply defined symbols found
error LNK2005: _main already defined in lua.obj

I'd be grateful if anyone could guide me through the creation of a VS2010 solution for Lua 5.2 alpha, or point me to related resources.

Thanks in advance.

like image 448
Raine Avatar asked Dec 07 '22 21:12

Raine


1 Answers

You are most probably compiling both luac.c and lua.c in one VS project. To build Lua yourself in VS you need three projects:

library - this should be either DLL or static library project. Should include every .c file under src/ except luac.c and lua.c. You only need this if you are embedding.

compiler - console executable, containing luac.c

interpreter - console executable, containing lua.c

like image 82
sbk Avatar answered Jan 16 '23 04:01

sbk