luafilesystem
luafilesystem copied to clipboard
installing on windows fails with LNK1107 (lua 5.2)
Can't install using luarocks on windows 10 with lua 5.2
c:\Users\soapdog\prog\lua\luarocks-2.4.0-win32>luarocks install luafilesystem
Installing https://luarocks.org/luafilesystem-1.6.3-2.src.rock
cl /nologo /MD /O2 -c -Fosrc/lfs.obj -IC:/lua/include src/lfs.c
lfs.c
link -dll -def:lfs.def -out:lfs.dll C:/lua/lua52.dll src/lfs.obj
Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation. All rights reserved.
C:\lua\lua52.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x330
Error: Build error: Failed compiling module lfs.dll
luabinaries has a folder for Static windows libraries: https://sourceforge.net/projects/luabinaries/files/5.3.4/Windows%20Libraries/Static/
Those zip files contain lua53.lib. As described on #22, edit your config to point to that lib file.
You need the right one for your version of Visual Studio. See the "Windows Libraries Downloads" section of that page for more info.
How did you build your lua binaries? Seems the microsoft toolchain is used while building lfs, whereas the Lua binaries seem to have been build with MinGW or other gcc toolchains.
whoops, only now seeing this is a very old issue, got triggered by the previous comment.
@soapdog did you fix your issue? Can you post your resolution and close this issue if so?
@Tieske, I couldn't solve it myself. Ended up using Lua For Windows which has it already https://github.com/rjpcomputing/luaforwindows
I came across this error on Windows when, in the Luarocks configuration, both CC
and LD
were set to cl
. I fixed it by keeping CC
as cl
, and changing LD
to link
.