Hello.I've been looking for a free C++ compiler for windows which supports the new standard features but i had little luck so far.Does someone have any knowledge of one? Thank you in advance.

Recommended Answers

All 9 Replies

I know the GNU g++ complier has limited support with the -std=gnu++0x switch.

There isn't a single compiler that supports all of C++0x at this point. I believe GCC (starting at 4.6 or 4.7) is the closest though, if you want to play with C++0x I'd go with GCC.

Thanks but i can't install Linux on that machine.How about Visual Studio Express 2008? I've never used Visual Studio before so i don't really know.

Thanks but i can't install Linux on that machine.

GCC isn't restricted to Linux. Try the nuwen build of MinGW if you're on Windows, it's up to GCC 4.6.1. If you're on OSX, macports offers a recent build of GCC as well.

How about Visual Studio Express 2008?

True C++0x support starts with 2010 (stuff like long long was supported as an extension before), but the list of features is relatively short compared to GCC. Unfortunately, it doesn't seem like 2011 will be much better (still no variadic templates, for example).

Yes I think Visual studio 2010 has it

You don't need to install Linux. You can install code::blocks and then link it to a gcc compiler. Check this out.

Definitely GCC is the best (and only) compiler right now that has a pretty good support for C++0x (C++11) features. A quick look at this table reveals this pretty clearly. And specifically for GCC here. From looking at the list, you can see that 4.6 is a pretty good version, the things added by the absolute newest version (4.7) are not that important (and, of course, 4.7 is not released yet, but under development, so it can be hard to get it working on Windows). As suggested, you can use the nuwen build of MinGW for the state-of-the-art releases of GCC for windows. Using Cygwin is also an option I guess.

As for MSVC, don't even think about any version before 2010. Also note that, unlike GCC, MSVC enables C++0x features by default (in GCC you have to use the option -std=c++0x , or -std=gnu++0x for the GNU dialect). I wouldn't put too much hope in MSVC for standard compliance (considering the MSVC 2008 is the first decent version with respect to the C++98 standard), although this post is encouraging.

Another important consideration is the standard library support. On GCC, it is pretty close to complete (except for the things that rely on unsupported language features, and other the notable unsupported libraries are Regex and Future). As for MSVC10, I don't think they have done much more than promoting the TR1 libraries. However, good news! MSVC11 will feature an almost complete standard library support, although major language features will still be lacking. This msdn blog post takes a nice deep look into MSVC11 C++11 features. And this comment on it is also very interesting.

In my opinion, the MSVC10 support for C++11 is not good enough to really do much playing around with C++11 features (except for rvalue-refs). On the other hand, GCC's support for C++11 features is pretty good, but a few important things are still missing, especially template aliases and delegating/inheriting constructors! But so far, it seems like C++11 feature support is moving forward pretty quickly, maybe we will even have essentially full support on the three major compilers (MSVC, GCC, and ICC) in little more than a year from now.

For production code, I would still suggest that you keep it to C++03, and if you want to use C++11 features, then condition their use against a compilation flag (like "ENABLE_CXX11_FEATURES").

You all have my full gratitude.I was actually hoping the GCC is available on Windows but i guess i didn't do enough research.Anyway thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.