20

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;
}
Adrian Maire
  • 14,354
  • 9
  • 45
  • 85

1 Answers1

18

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.

greatwolf
  • 20,287
  • 13
  • 71
  • 105
  • thanks your! I have tryed to install the Mingw-W64 but get error (it seem to has not access to his repository, probably a temporal issue with their servers). The second option work fine. – Adrian Maire Aug 01 '13 at 09:22
  • 2
    @Adrian Maire MinGW w64 is a very good compiler, i use it all the time. mingwbuilds provides the best general builds and is used by many in the areospace and automotive industries. You can find their 64 bit builds [here](http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/5.3.0/), there's pivots for seh and sjlj, as well as posix and win32 threading models. – Jonathan Jan 22 '16 at 23:38
  • Orwell DevCpp did it! ...or later version of TDM-GCC, of course. – Per Lindberg May 19 '16 at 14:47