lua-users home
lua-l archive

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




On Wed, Jun 20, 2018 at 10:16 PM, Egor Skriptunoff <egor.skriptunoff@gmail.com> wrote:
On Thu, Jun 21, 2018 at 12:43 AM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> I'm unable to build luac.exe
> luac.obj : error LNK2005: luaP_opmodes already defined in lopcodes.obj
> luac.exe : fatal error LNK1169: one or more multiply defined symbols found

Why did the linker try to resolve symbols in lopcodes.obj since
presumably  luac.obj is listed before lua.lib?
How are you building luac.exe?


I'm using script based on "etc/luavs.bat" to build Lua under Visual Studio command prompt.
It worked perfectly with all previous versions of Lua.
 
@setlocal
@set MYCOMPILE=cl /nologo /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE
@set MYLINK=link /nologo
cd src
%MYCOMPILE% /DLUA_BUILD_AS_DLL l*.c
del lua.obj luac.obj
%MYLINK% /DLL /out:lua54.dll l*.obj
%MYCOMPILE% /DLUA_BUILD_AS_DLL lua.c
%MYLINK% /out:lua.exe lua.obj lua54.lib
%MYCOMPILE% l*.c
del lua.obj linit.obj lbaselib.obj ldblib.obj liolib.obj lmathlib.obj loslib.obj ltablib.obj lstrlib.obj loadlib.obj
%MYLINK% /out:luac.exe *.obj
del *.obj
cd ..

 
Should I set the correct order of .obj files for linker invocation?
What is this order?

I can't believe how long that's been sitting there and I didn't know about it. I'm going to post this on the winlua github site. Egor, my I add your name to the contributors list?

Russ