MinGW64无法编译32位代码 [英] MinGW64 cannot compile 32bit code
问题描述
我已从此链接下载了MinGW x64-4.8.1-posix-sjlj-rev1但是当我尝试为x86目标构建时我有很多的连接错误...似乎只有x64 lib安装...
I've downloaded MinGW from this link x64-4.8.1-posix-sjlj-rev1 but when I try to build for x86 target I've lots of linkage errors... seems that only x64 lib are installed...
我需要为Windows上的x86和x64平台构建...我要下载x64和x86或者更简单的方法吗?
I've need to build for x86 and x64 platforms on windows... Have I to download both x64 and x86 or are some simpler ways?
编辑我使用eclipse keplero作为IDE
我试着建立一个简单的hello世界程序与 g ++ -m32 -std = c ++ 11 test.cpp -o test32.exe
和 g ++ -m64 -std = c ++ 11 test.cpp -o test64.exe
。所有的确定...所以问题是与eclipse ...一个小发现,我需要使用MYSY(在PATH中设置)和设置-m32也在c ++链接选项...
Edit I'm using eclipse keplero as IDE
I've tryed to build myself a simple hello world program with g++ -m32 -std=c++11 test.cpp -o test32.exe
and g++ -m64 -std=c++11 test.cpp -o test64.exe
. And all is ok... So the problem was with eclipse... After a little a discovered that I need to use MYSY ( set in PATH ) and set -m32 also in the c++ linkage options...
现在一切正常了。
我也尝试使用NetBeans C ++作为IDE ...似乎是一个gread IDE! !
I've also tryed to use NetBeans C++ as IDE... seems a gread IDE!!!
推荐答案
启用 multilib
。这就是为什么你不能编译32位(x86)程序。您可以从以下链接获取 multilib
启用的工具链:
It is not multilib
enabled. That's why you are not able to compile 32-bit(x86) program. You can get multilib
enabled toolchain from following link:
对于64位机器: 64位
对于32位机器: 32-位
这篇关于MinGW64无法编译32位代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!