【问题标题】:Luarocks error building luafilesystemLuarocks 错误构建 luafilesystem
【发布时间】:2015-03-06 15:16:17
【问题描述】:

我正在使用 Luarocks 2.2.0beta1 在带有 lua 5.2mingw 的 windows 7 上安装 luafilesystem .我收到了这个错误:

>luarocks install luafilesystem
Installing http://rocks.moonscript.org/luafilesystem-1.6.2-2.src.rock...
Using http://rocks.moonscript.org/luafilesystem-1.6.2-2.src.rock... switching to 'build' mode
mingw32-gcc -O2 -c -o src/lfs.o -IC:/lua/include/src/lfs.c
mingw32-gcc -shared -o lfs.dll src/lfs.o C:/lua/bin/lua52.dll -lm
C:\lua\bin\lua52.dll: file not recognized: File format not recognized
collect2.exe: error: Id returned 1 exit status

Error: Build error: Failed compiling module lfs.dll

知道如何解决这个问题吗?

注意:到现在为止,我在安装与 luafilesystem 没有依赖关系的 luarocks 的其他模块时没有问题。

【问题讨论】:

  • 这些行之前是什么?
  • 可能是 32 位到 64 位的问题。您是否使用与您现在尝试使用相同的 MinGW 编译器自己编译 lua52.dll
  • @EtanReisner 我已经写完全文了
  • @siffiejoe 是的,我使用相同的 mingw 编译器编译它。我尝试过使用其他编译器的 dll,但它也不起作用。

标签: lua mingw luarocks


【解决方案1】:

已解决,出现此问题是因为实际上我在构建 lua52.dll 时没有使用相同的 MinGW 编译器。我不知道我第一次使用哪个编译器。感谢@siffiejoe

【讨论】:

  • 注意,您可以使用 CFF Explorer 或任何 PE 二进制解析器(例如 objdump、nm 或 dumpbin)来识别 dll 的位格式。
猜你喜欢
  • 2016-07-15
  • 2014-11-27
  • 2012-02-26
  • 2014-07-26
  • 2016-03-25
  • 2018-12-07
  • 2015-02-01
  • 2021-10-28
  • 2018-11-29
相关资源
最近更新 更多