g++.exe 和 x86_64-w64-mingw32-g++.exe 有什么区别? [英] What is the difference between g++.exe and x86_64-w64-mingw32-g++.exe?

查看:314
本文介绍了g++.exe 和 x86_64-w64-mingw32-g++.exe 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

同样的问题也适用于 gcc、ar 等.

Same question goes for gcc, ar, etc. as well.

在 Code::Blocks 中将工具链可执行文件从 something.exe 更改为 x86_64-w64-mingw32-something.exe 后,代码仍然可以完美编译.此外,32 位和 64 位模式在这两种情况下都能完美运行.

On changing the toolchain executable from something.exe to x86_64-w64-mingw32-something.exe in Code::Blocks, the code still compiles perfectly. Also, both 32-bit and 64-bit modes work perfectly in both the cases.

g++ -vx86_64-w64-mingw32-g++.exe -v 在命令行上显示相同的输出.

g++ -v and x86_64-w64-mingw32-g++.exe -v show the same output on command line.

如果这些完全相同,为什么它们作为不同的可执行文件提供?

If these are exactly the same, why are they provided as different executables?

推荐答案

x86_64-w64-mingw32-g++.exe 是一种交叉编译器,用于编译可以在与编译时在不同类型计算机上运行的代码(根据名称,它看起来像 Windows 64 位).g++ 是常规编译器,用于编译代码以在同一台计算机或同一类型的计算机上运行.在您的系统上(例如,如果您的系统是 64 位 Windows),它们可能会做同样的事情.

x86_64-w64-mingw32-g++.exe is a cross compiler, for compiling code that can run on a different type of computer than the one it was compiled on (based on the name, it looks like Windows 64-bit). g++ is the regular compiler, for compiling code to run on the same computer or same type of computer. On your system (e.g. if your system is 64-bit Windows) it's possible that they do the same thing.

这篇关于g++.exe 和 x86_64-w64-mingw32-g++.exe 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆