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 <> wrote:
On Thu, Jun 21, 2018 at 12:43 AM, Luiz Henrique de Figueiredo <> 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.
@set MYLINK=link /nologo
cd src
del lua.obj luac.obj
%MYLINK% /DLL /out:lua54.dll l*.obj
%MYLINK% /out:lua.exe lua.obj lua54.lib
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?