Hello i am trying to install the 64 bit compiler of MinGW so that i can program in c 64 bit but am not sure exactly how to accomplish this. I have download the 64 bit zip file and extracted it to the folder i want but am not sure how to get the compiler to work. My command line still seems to recognize the program i am using as 64 bit.
Any help is appreciated.
Step by step instructions:
1) Download and extract mingw package from mingw-builds:
(actually first one should work fine on both host platforms)
2) Lets say the target directory was c:\mingw
Copy the code below to the test.cpp
#include <cstdio>
int main() {
printf("sizeof(void*)=%d bytes\n", sizeof(void*));
return 0;
}
3) Compile 32 bit target:
c:\mingw\bin\i686-w64-mingw32-c++.exe -m32 -o test.exe test.cpp
OR
c:\mingw\bin\x86_64-w64-mingw32-c++.exe -m32 -o test.exe test.cpp
4) Compile 64 bit target:
c:\mingw\bin\i686-w64-mingw32-c++.exe -m64 -o test.exe test.cpp
OR
c:\mingw\bin\x86_64-w64-mingw32-c++.exe -m64 -o test.exe test.cpp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With