MinGW GCC -单个32位和64位交叉编译器?

时间:2023-01-22 07:09:52

I've downloaded MinGW with mingw-get-inst, and now I've noticed that it cannot compile for x64.

我下载了MinGW和MinGW -get-inst,现在我注意到它不能为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?

因此,是否有任何32位二进制版本的MinGW编译器,既可以编译32位窗口,也可以编译64位窗口?

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. :(

我不希望64位版本能够生成32位代码,因为我希望编译器也能在32位的Windows上运行,而且我只在这里查找预编译的二进制文件,而不是源文件,因为我花了无数个小时编译GCC和失败,我已经放弃了一段时间。:(

2 个解决方案

#1


5  

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.

AFAIK mingw的目标是32位windows或64位windows,但不是两个,所以你需要两个安装。而后者仍然被认为是测试版。

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.

如果您想为windows 64编译,您想要的是mingw-w64-bin_i686-mingw或mingw-w64-bin_i686-cygwin。对于win32,只需要使用你在mingw-get-inst中得到的东西。

See http://sourceforge.net/apps/trac/mingw-w64/wiki/download%20filename%20structure for an explanation of file names.

请参见http://sourceforge.net/apps/trac/ming-w64/wiki/download% 20filename%20structure以解释文件名。

#2


3  

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).

经过大量的研究,我发现,到现在,多年以后,在从您的存储库(即synaptic)安装mingw时,两个编译器通常都是默认安装的。

You can check and verify by running Linux's locate command:

您可以通过运行Linux的locate命令来检查和验证:

 $ locate -r "mingw32.*[cg]++$"

On my Ubuntu (13.10) install I have by default the following compilers to choose from... found by issuing the locate command.

在我的Ubuntu(13.10)安装上,我默认有以下编译器可供选择……通过发出locate命令找到。

/usr/bin/amd64-mingw32msvc-c++
/usr/bin/amd64-mingw32msvc-g++
/usr/bin/i586-mingw32msvc-c++
/usr/bin/i586-mingw32msvc-g++
/usr/bin/i686-w64-mingw32-c++
/usr/bin/i686-w64-mingw32-g++
/usr/bin/x86_64-w64-mingw32-c++
/usr/bin/x86_64-w64-mingw32-g++

Finally, the least you'd have to do on many systems is run:

最后,在许多系统上,你至少需要运行:

$ sudo apt-get install gcc-mingw32

I hope the many links to this page can spare a lot of programmers some search time.

我希望这个页面的许多链接可以让很多程序员节省一些搜索时间。

#1


5  

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.

AFAIK mingw的目标是32位windows或64位windows,但不是两个,所以你需要两个安装。而后者仍然被认为是测试版。

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.

如果您想为windows 64编译,您想要的是mingw-w64-bin_i686-mingw或mingw-w64-bin_i686-cygwin。对于win32,只需要使用你在mingw-get-inst中得到的东西。

See http://sourceforge.net/apps/trac/mingw-w64/wiki/download%20filename%20structure for an explanation of file names.

请参见http://sourceforge.net/apps/trac/ming-w64/wiki/download% 20filename%20structure以解释文件名。

#2


3  

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).

经过大量的研究,我发现,到现在,多年以后,在从您的存储库(即synaptic)安装mingw时,两个编译器通常都是默认安装的。

You can check and verify by running Linux's locate command:

您可以通过运行Linux的locate命令来检查和验证:

 $ locate -r "mingw32.*[cg]++$"

On my Ubuntu (13.10) install I have by default the following compilers to choose from... found by issuing the locate command.

在我的Ubuntu(13.10)安装上,我默认有以下编译器可供选择……通过发出locate命令找到。

/usr/bin/amd64-mingw32msvc-c++
/usr/bin/amd64-mingw32msvc-g++
/usr/bin/i586-mingw32msvc-c++
/usr/bin/i586-mingw32msvc-g++
/usr/bin/i686-w64-mingw32-c++
/usr/bin/i686-w64-mingw32-g++
/usr/bin/x86_64-w64-mingw32-c++
/usr/bin/x86_64-w64-mingw32-g++

Finally, the least you'd have to do on many systems is run:

最后,在许多系统上,你至少需要运行:

$ sudo apt-get install gcc-mingw32

I hope the many links to this page can spare a lot of programmers some search time.

我希望这个页面的许多链接可以让很多程序员节省一些搜索时间。