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;
}
4
  • 1
    Which version of MinGW do you have? There seems to be a separate distro for 64 bit. Commented Aug 1, 2013 at 8:37
  • 5
    +1 for "I dont want MSVC++ (cause of ethical issues)" Commented Aug 1, 2013 at 8:41
  • @doctorlove MinGW GCC 4.7.2 32-bit Commented Aug 1, 2013 at 8:43
  • 1
    @AdrianMaire I've added some more details you can try out that may be easier. Commented Aug 1, 2013 at 9:11

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

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 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, there's pivots for seh and sjlj, as well as posix and win32 threading models.
Orwell DevCpp did it! ...or later version of TDM-GCC, of course.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.