将64位nasm与mingw-64原因链接到未识别的“文件格式”错误
我正在尝试使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,尽管我下载并安装了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.