I created a program in C++2011 that actually uses features of C++2011: mutex
, unique_lock
, condition_variable
, future
and async
.
I've tested it on Debian Linux 64 bits box, and it compiles and runs like a charm.
Now, I want to compile it for Windows.
I tried Visual C++ Express 2010, but it does not have support for the new features of C++. (The Beta for Visual C++/Studio 2012 only runs on Windows 8.)
I tried cross compiling with mingw-g++ (4.6), but it looks like these new features are not supported for the Windows target. (Although they are supported for g++-4.6 for Linux target).
Is there any (free?) solution as of today to compile a C++2011 program for Windows target?
The Visual Studio build tools include a C compiler that you can use to create everything from basic console programs to full Windows Desktop applications, mobile apps, and more.
My (commercial) Just::Thread library provides std::thread
, std::mutex
and friends for MSVC 2005/2008/2010 and the TDM port of mingw-gcc 4.5/4.6 on Windows. It's not free, though.
Alternatively, look for a build of gcc 4.7 for mingw. Support for the thread library on Windows is supposed to be available out-of-the-box with gcc 4.7, but it's not officially released yet.
I have not tried it yet, but this quote from the project site sounds promising:
"Builds support the following technologies:
OpenMP
LTO
Graphite
std_threads
std_atomics
..."
http://code.google.com/p/mingw-builds/
hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With