将64位nasm与mingw-64原因链接到未识别的“文件格式”错误

发布于 2025-01-27 16:02:17 字数 422 浏览 1 评论 0原文

我正在尝试使用MINGW-64BIT在Windows上组装并链接一个具有以下批处理命令的64位NASM程序:

nasm -f win64 HelloWorld.asm && "C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin\gcc.exe" HelloWorld.obj -o HelloWorld.exe

但是我会收到此错误:

HelloWorld.obj: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status

如何解决此问题?

I am trying to assemble and link a 64-bit NASM program on Windows using MinGW-64bit with the following batch command:

nasm -f win64 HelloWorld.asm && "C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin\gcc.exe" HelloWorld.obj -o HelloWorld.exe

But I get this error:

HelloWorld.obj: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status

How can I fix this?

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

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

发布评论

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

评论(1

牵强ㄟ 2025-02-03 16:02:17

事实证明,尽管我下载并安装了mingW-64,但我仍然获得了32位版本,因为我在安装时选择了i686选项。我重新安装了“ X86-64”选项,并解决了问题。

It turns out that, although I downloaded and installed MinGW-64, I still got a 32-bit version because I selected the i686 option upon installation. I reinstalled with the "x86-64" option and it fixed the problem.

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