I’m ok with using Cygwin or MinGW, but I need to end up with 64-bit code, not 32-bit. This is because I will be calling the DLL from 64-bit managed C#. I can’t seem to find and good references for setting up those tools to create 64-bit binaries. Also, it would be nice if the GCC was version 4, not version 3 as came with my Cygwin install.
An alternative would be some form of interprocess communication. I will research that, but what I laid out above is what I really want.
The 64-bit MinGW, based on (just released) gcc-4.4.0, is probably your best bet.
(Since the mingw-w64 project on sourceforge.net is moving to mingw-w64.org it’s better to use mingw-w64.org)
Detailed instructions:
1. Download the archive
2. Extract it somewhere under cygwin. In my case, top-level cygwin directory is
C:\cygwin, I extracted the package intomingwdirectory, and ended up with the following contents inC:\cygwin\mingw(which is visible as/mingwunder cygwin:3. Now compile some C++ code. I used:
And compile it like this:
4. Finally, verify the result is a Windows/x 64 executable, by running
dumpbin /headers a.exe: