MinGW GCC——单个 32 位和 64 位交叉编译器?
我已经使用 mingw-get-inst< 下载了 MinGW /a>,现在我注意到它无法编译为 x64。
那么是否有 32 位 二进制 版本的 MinGW 编译器既可以为 32 位 Windows 编译,也可以为 64 位 Windows 编译?
我不想要可以生成 32 位代码的 64 位版本,因为我希望编译器也可以在 32 位 Windows 上运行,并且我只是在此处查找预编译的二进制文件,而不是源文件,因为我'我花了无数个小时编译 GCC 但失败了,我已经放弃了一段时间了。 :(
I've downloaded MinGW with mingw-get-inst, and now I've noticed that it cannot compile for x64.
So is there any 32-bit binary version of the MinGW compiler that can both compile for 32-bit Windows and also for 64-bit Windows?
I don't want a 64-bit version that can generate 32-bit code, since I want the compiler to also run on 32-bit Windows, and I'm only looking for precompiled binaries here, not source files, since I've spent countless hours compiling GCC and failing, and I've given up for a while. :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
AFAIK mingw 针对 32 位 Windows 或 64 位 Windows,但不能同时针对两者,因此您需要安装两次。后者仍被认为是测试版。
对于您来说,您想要的是 mingw-w64-bin_i686-mingw 或 mingw-w64-bin_i686-cygwin 如果您想针对 windows 64 进行编译。对于 win32,只需使用您通过 mingw-get-inst 获得的内容即可。
请参阅http://sourceforge.net/apps/trac/mingw-w64/wiki/download %20filename%20struct 用于文件名的解释。
AFAIK mingw targets either 32 bit windows or 64 bit windows, but not both, so you would need two installs. And the latter is still considered beta.
For you what you want is either mingw-w64-bin_i686-mingw or mingw-w64-bin_i686-cygwin if you want to compile for windows 64. For win32, just use what you get with mingw-get-inst.
See http://sourceforge.net/apps/trac/mingw-w64/wiki/download%20filename%20structure for an explanation of file names.
我意识到这是一个老问题。然而,这与该问题多次重复有关。
经过大量研究,我发现,几年后的今天,从存储库(即突触)安装 mingw 时,通常会默认安装这两个编译器。
您可以通过运行Linux的locate命令进行检查和验证:
在我的Ubuntu(13.10)安装中,默认情况下我有以下编译器可供选择...通过发出locate命令找到。
最后,在许多系统上您至少要做的就是运行:
我希望此页面的许多链接可以为许多程序员节省一些搜索时间。
I realize this is an old question. However it's linked to the many times the question has been repeated.
I have found, after lots of research that, by now, years later, both compilers are commonly installed by default when installing mingw from your repository (i.e. synaptic).
You can check and verify by running Linux's locate command:
On my Ubuntu (13.10) install I have by default the following compilers to choose from... found by issuing the locate command.
Finally, the least you'd have to do on many systems is run:
I hope the many links to this page can spare a lot of programmers some search time.
对于您的情况,您可以下载 Mingw64 的 multilib(包括 lib32 和 lib64)版本:
Multilib 工具链(针对 Win32 和 Win64)
默认情况下,它是为 64 位编译的。您可以添加 -m32 标志来编译 32 位程序。
但遗憾的是,没有提供 gdb,你应该手动添加它。
因为根据 mingw-64 的待办事项列表,gcc multilib 版本已完成,但 gdb
multilib版本仍在开发中,也许将来你可以使用它。
mingw-64-todo-list
for you situation, you can download multilib (include lib32 and lib64) version for Mingw64:
Multilib Toolchains(Targetting Win32 and Win64)
By default it is compiled for 64bit.You can add -m32 flag to compile for 32bit program.
But sadly,no gdb provided,you ought to add it manually.
Because according to mingw-64's todo list, gcc multilib version is done,but gdb
multilib version is still in progress,you could use it maybe in the future.
mingw-64-todo-list