Compile 64-bit binary with MinGW (Dev-C++)

风格不统一 提交于 2019-12-30 05:46:46

问题


It is probably a stupid question but i was searching for the answer from about 3h.

¿How to compile 64-bit binary with (Dev-C++) MinGW?

I have readed that MinGW support 64bits by default, but i am unable to active this option.

I have tryed "-m64" but it say: "sorry, unimplemented: 64-bit mode not compiled in"

I am working on Dev-C++ on Windows-7

I know how to do it on MSVC++, but I don't want MSVC++ (cause of ethical issues)

What i am trying to compile, just for testing purpose:

#include <iostream>
using namespace std;

int main(int argc, char* argv[])
{   
    // Test compiling mode
    if (sizeof(void*) == 8) cout << "Compiling 64-bits" << endl;
    else cout << "Compiling 32-bits" << endl;

    return 0;
}

回答1:


To build a 64-bit binary on windows you need the 64-bit version of the mingw compiler. Mingw-W64 is one possible distribution you can use. You can find a list of downloads here.

Additionally, you can also find Dev-C++ setup bundled with mingw 64-bit compiler under Orwell Dev-C++'s download section. Make sure you choose "TDM-GCC x64 4.7.1" either setup or portable.



来源:https://stackoverflow.com/questions/17988904/compile-64-bit-binary-with-mingw-dev-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!