尝试使用 luarocks 安装时无法识别 mingw-gcc

发布于 2025-01-16 03:36:02 字数 676 浏览 1 评论 0原文

我的路径中有 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 时仍然遇到相同的错误

I have lua in my path and luarocks is in the same folder in Program Files. I'm trying to install luafilesystem and I am receiving this error.

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>

I tried installing mingw64 through the installer on mingw site thinking that would work as a fix, but it gives a "downloaded incorrectly" error in the installer. Also tried installing mingw using msys and that seemed to install but still getting the same error trying to install luafilesystem

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

很酷不放纵 2025-01-23 03:36:02

如果 gcc 已安装并且位于您的路径中,则在运行 luarocks 之前,我可以通过将我的 gcc.exe 编译器重命名为 mingw32-gcc.exe 来修复此错误安装命令。这有点老套,但我还没有遇到任何问题。

If gcc is installed and in your Path, I was able to fix this error by renaming my gcc.exe compiler to mingw32-gcc.exe before running the luarocks install command. It's a bit hacky but I haven't run into any issues with it.

巷雨优美回忆 2025-01-23 03:36:02

安装 mingw 确实应该可以解决问题,但并没有就此结束。我已经安装了 mingw,gcc 简称为 gcc(而不是 mingw32-gcc),因此错误仍然存​​在。您可以检查一下这是否也是您的问题。

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

Installing mingw should indeed solve the issue, but it doesn't end there. I have installed mingw, and gcc is simply called gcc (not mingw32-gcc), therefore the error persists. You may check if that is your problem as well.

A solution that I deemed good enough was switching to MSVC and running luarocks from the developer command prompt: luarocks should automatically detect the compiler and use it, but if you want to use gcc you should look for how to solve that naming issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文