Giter Site home page Giter Site logo

link error about luafilesystem HOT 7 CLOSED

lunarmodules avatar lunarmodules commented on June 15, 2024
link error

from luafilesystem.

Comments (7)

soapdog avatar soapdog commented on June 15, 2024 2

This is still happening 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

from luafilesystem.

hoensr avatar hoensr commented on June 15, 2024

I have the same issue. Here is what I get when I want to install the rock:

Using luafilesystem-1.6.2-2.src.rock... switching to 'build' mode
cl /MD /O2 -c -Fosrc/lfs.obj -Ic:/lua/include/ src/lfs.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

lfs.c
c:\users\hoensr\appdata\local\temp\luarocks_luafilesystem-1.6.2-2-9080\luafilesystem-1.6.2\src\lfs.c(413) : warning C4716: 'make_link' : must return a value
link -dll -def:lfs.def -out:lfs.dll c:/lua/lua51.dll src/lfs.obj
Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

c:\lua\lua51.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x270

I tried to link against Lua 5.1.5, lua51.dll is 11KB.
Luarocks is version 2.1.2.

Any ideas?

from luafilesystem.

hishamhm avatar hishamhm commented on June 15, 2024

According to http://social.msdn.microsoft.com/Forums/vstudio/en-US/81c26278-3965-4567-8b1a-bb9e98b5f53a/fatal-error-lnk1107-invalid-or-corrupt-file-cannot-read-at-0x168?forum=vcgeneral

This indicates that a file you passed into the linker is not a binary file. Check your linker command line and make sure the files being passed are recognised by the linker. You can find a list of recognised file types here.

Following that link, the list of recognized file types is:

.obj files
.netmodule files
.lib files
.exp files
.def files
.pdb files
.res files
.exe files
.txt files
.ilk files

The command-line above says:

link -dll -def:lfs.def -out:lfs.dll c:/lua/lua51.dll src/lfs.obj

So perhaps there should be a .lib file there instead of .dll? Check you LuaRocks configuration.

from luafilesystem.

SergNikitin avatar SergNikitin commented on June 15, 2024

Got the exact same issue, switching to lua5.1.lib in LuaRocks config fixed the problem.

It is worth noting that looks like for some reason LuaRocks install script searches for lua51.dll (without extra dot) and for lua5.1.lib (with extra dot). So if you want to make this process automated, you need to remember that if you wish to make the installation of LuaRocks fully automated.

from luafilesystem.

bonez001 avatar bonez001 commented on June 15, 2024

where can I find lua5.3.lib?

from luafilesystem.

hishamhm avatar hishamhm commented on June 15, 2024

@soapdog Do you have c:\lua\lua52.lib in your system?

Try editing your LuaRocks config file and change the value of LUALIB to point to the lua52.lib file.

LuaRocks will tell the location of your config file if you type luarocks with no arguments.

from luafilesystem.

soapdog avatar soapdog commented on June 15, 2024

@hishamhm I don't have it. I have lua52.dll and liblua52.a. My lua prebuilt binaries came from luabinaries project. They are not shipping lua52.lib on their windows download. Should the lib point to a DLL on windows? Also, thanks for the quick reply, I moved this to #82 because this issue is closed here.

from luafilesystem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.