Sea*_*ean 4 c install mingw windows-7-x64
您好我正在尝试安装MinGW的64位编译器,以便我可以用64位编程,但我不确定如何完成此操作.我已下载64位zip文件并将其解压缩到我想要的文件夹但不知道如何让编译器工作.我的命令行似乎仍然认为我使用的程序为64位.
任何帮助表示赞赏.
小智 9
分步说明:
1)从mingw-builds下载并提取mingw包:
(实际上第一个应该在两个主机平台上正常工作)
2)让我们说目标目录是c:\ mingw
将下面的代码复制到test.cpp
#include <cstdio>
int main() {
printf("sizeof(void*)=%d bytes\n", sizeof(void*));
return 0;
}
Run Code Online (Sandbox Code Playgroud)
3)编译32位目标:
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
Run Code Online (Sandbox Code Playgroud)
4)编译64位目标:
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
Run Code Online (Sandbox Code Playgroud)