MinGW64 cannot compile 32-bit code

I downloaded MinGW from this link x64-4.8.1-posix-sjlj-rev1 , but when I try to build for the x86 target I have many communication errors ... it seems that only x64 lib is installed ...

I need to build for x86 and x64 platforms on windows ... Do I need to download both x64 and x86 or a few simpler methods?

Edit I use eclipse keplero as an IDE I tried to create a simple peaceful hello program with g++ -m32 -std=c++11 test.cpp -o test32.exe and g++ -m64 -std=c++11 test.cpp -o test64.exe . And that's all right ... So the problem was in eclipse ... After I discovered that I need to use MYSY (set to PATH) and set -m32 also in the C ++ binding option ...

Now everything is fine.

I also tried using NetBeans C ++ as an IDE ... it seems like in an IDE!

+1
c ++ 11 mingw-w64 mingw32
source share
1 answer

It is not included multilib . This is why you cannot compile a 32-bit (x86) program. You can get the multilib activated toolchain from the following link:

For a 64-bit machine: 64-bit

For 32-bit machine: 32-bit

+1
source share

All Articles