【问题标题】:Getting mingw-gcc not recognized when trying to install using luarocks尝试使用 luarocks 安装时无法识别 mingw-gcc
【发布时间】:2023-01-31 18:30:52
【问题描述】:

我的路径中有 lua,而 luarocks 位于 Program Files 中的同一文件夹中。我正在尝试安装luafilesystem,但收到此错误。

PS C:\Users\Owner> luarocks install luafilesystem
Installing https://luarocks.org/luafilesystem-1.8.0-1.src.rock

luafilesystem 1.8.0-1 depends on lua >= 5.1 (5.3-1 provided by VM)
mingw32-gcc -O2 -c -o src/lfs.o -IC:\Program Files\lua/include src/lfs.c
'mingw32-gcc' is not recognized as an internal or external command,
operable program or batch file.

Error: Build error: Failed compiling object src/lfs.o
PS C:\Users\Owner>

我尝试通过 mingw 站点上的安装程序安装 mingw64,认为这可以作为修复,但它在安装程序中给出了“下载不正确”的错误。还尝试使用 msys 安装 mingw 并且似乎安装了但仍然遇到相同的错误尝试安装 luafilesystem

【问题讨论】:

  • 您应该在特殊的 MSYS 控制台窗口中键入构建命令,而不是在 PowerShell 窗口中。

标签: windows lua luarocks


【解决方案1】:

安装mingw确实应该可以解决问题,但还不止于此。我已经安装了mingw,而gcc只是被称为gcc(而不是mingw32-gcc),因此错误仍然存​​在。您也可以检查这是否是您的问题。

我认为足够好的解决方案是切换到 MSVC 并从开发人员命令提示符运行 luarocks:luarocks 应该自动检测编译器并使用它,但如果你想使用 gcc,你应该寻找如何解决该命名问题。

【讨论】:

    猜你喜欢
    • 2016-02-28
    • 2018-05-05
    • 1970-01-01
    • 2015-08-20
    • 1970-01-01
    • 2012-11-29
    • 1970-01-01
    • 2018-08-03
    • 1970-01-01
    相关资源
    最近更新 更多