Sign in to follow this  
MarkS

List of C++11 compliant compilers?

Recommended Posts

MarkS    3502

I'm getting fed up with Visual Studio Express 2012. There are so many new language features that I can only look at in code samples.

 

Are there any *free* Windows-based C++11 compilers? What are some recommendations?

Share this post


Link to post
Share on other sites
swiftcoder    18437


else you can download last Qt package and just add the -std=c++ flag to project file options (you get the mingw 4.8.x package along with Qt IDE).

QFE.

 

QtCreator is one of the nicest of the non-Microsoft IDEs, and you get a shiny new C++0x-capable GCC, into the bargain.

Share this post


Link to post
Share on other sites
Chris_F    3030

For GCC on Windows I would suggest:

 

http://tdm-gcc.tdragon.net/

 

Which is very easy to install. You have your choice of 32-bit only or 32/64-bit. GGC version 4.7.1.

 

http://nuwen.net/mingw.html

 

Also pretty easy to install if I remember correctly. Not sure if it supports 64-bit, but it is GGC version 4.8.1 and comes with Boost 1.54 by default.

Edited by Chris_F

Share this post


Link to post
Share on other sites
LorenzoGatti    4450
 

For GCC on Windows I would suggest:
 
http://tdm-gcc.tdragon.net/
 
Which is very easy to install. You have your choice of 32-bit only or 32/64-bit. GGC version 4.7.1.
 
http://nuwen.net/mingw.html
 
Also pretty easy to install if I remember correctly. Not sure if it supports 64-bit, but it is GGC version 4.8.1 and comes with Boost 1.54 by default.

 
Sadly, stopping at 4.7.1 makes TDM-GCC almost as unmaintained as official MINGW releases. The other suggestion, Stephen T. Lavavej's distribution, remains my first choice.

Share this post


Link to post
Share on other sites
l0calh05t    1797

OP, have you tried the VS2013 preview? It supports more of C++11 -- indeed all, or nearly all, of the stuff you'd actually care to use. Again, its just a preview, but the real-deal is just around the corner.

 

Far from it. Implicit move generation is pretty important, and ref qualifiers are very helpful for correctness. And no proper constexpr. And no user defined literals. All delayed to post VC2013 CTPs (so not for production code). The saddest part? On the far right (lowest priority/farthest in the future) there are still two C++98 bullet points. Admittedly not that important but that standard is now 15 years old, and Visual Studio still isn't there yet, and I suspect that C++11/14 will take just as long.

 

Visual Studio is lagging behind extremely.

 

About Mingw, I usually get my MinGW from http://sourceforge.net/projects/mingwbuilds/ those are very up to date.

Edited by l0calh05t

Share this post


Link to post
Share on other sites
MarkS    3502

Thanks everyone. I think I've settled on Code::Blocks and MinGW. I like the IDE.
 
I did think about VS2013, but it was fleeting. Microsoft places so many unnecessary and artificial restrictions on the Express versions that it becomes, in many cases, unusable. Now they are limiting DX development and debugging to the paid versions? What's next? I was actually thinking about paying for the pro version until I remember the poor C++11 support. If there are better options, sticking with Microsoft's version gain me nothing but headaches. l0calh05t, they still haven't fully implemented C++98? Really? Yeah, I'll pass.
 

 

else you can download last Qt package and just add the -std=c++ flag to project file options (you get the mingw 4.8.x package along with Qt IDE).

QFE.
 
QtCreator is one of the nicest of the non-Microsoft IDEs, and you get a shiny new C++0x-capable GCC, into the bargain.

 


I've had Qt 5.1 with MinGW 4.8 for some time now and didn't realize what I had. I really HATE Qt's IDE. I really cannot quantify it, but it just irks me. I wanted to get involved in the Tiled project, but I cannot get past Qt's GUI. I really don't know why. Something about it just irritates me. unsure.png

Edited by MarkS

Share this post


Link to post
Share on other sites
Dario Oliveri    290

I agree: I tried Qt recently.. great IDE, but the Qt GUI API is a total mess-up and I hate it. You can still use it for create non-gui applications biggrin.png

 


 

About Mingw, I usually get my MinGW from http://sourceforge.net/projects/mingwbuilds/ those are very up to date.

 

 

Yes mingwbuilds is very good. Infact the article I linked in the first post explain how to setup mingwbuilds with an IDE. I found mingwbuilds interesting for few extra reasons (despite the fact that those are always up to date, stand alone packages): finally someone provided DLLs for runtimes (so every time you create an executable including "iostream" you don't get extra 600 KB but you just need the DLL, now a simple hello world is few KB instead of ~0.5MB) and a working std::thread (still using Posix wrapper instead of native windows thread but that's ok)

Edited by DemonRad

Share this post


Link to post
Share on other sites
MarkS    3502

I agree: I tried Qt recently.. great IDE, but the Qt GUI API is a total mess-up and I hate it. You can still use it for create non-gui applications biggrin.png


That's not what I meant. I meant the IDE's GUI. I haven't tried messing with the GUI API or much of anything related to Qt due to the IDE.

Share this post


Link to post
Share on other sites
MarkS    3502

I think it is important to note that MSVC's STL (essentially dinkumware) and clang's libc++ are way more complete than GCC's libstdc++


What are the differences?

Share this post


Link to post
Share on other sites
TheChubu    9454

Sadly, stopping at 4.7.1 makes TDM-GCC almost as unmaintained as official MINGW releases. The other suggestion, Stephen T. Lavavej's distribution, remains my first choice.

There is this project MinGW-w64 which seems fairly up to date. If you look at the builds, they have support for GCC 4.8.1, for both x86 and x86_64 platforms.

Edited by TheChubu

Share this post


Link to post
Share on other sites
Washu    7829

what exactly do you feel is missing, that you would like to use? While visual studio is missing quite a bit of C++11, it has a decent amount of it implemented, especially the more important bits. The other chunks and pieces that are missing aren't particularly important for most cases, doesn't mean you won't miss them though on the rare occasion.

 

There is a great deal to C++11, and no current compilers are "standards compliant," although clang makes a decent go at it.

 


That is minor in comparison to what is missing from Visual Studio. I have a feeling that gcc will be far better at implementing the standards than Microsoft.

I would consider the missing lack of a regular expressions library, part of the new standard library, to be a rather significant chunk of the C++ language to be missing. Especially since regular expressions tend to creep and find their way into so many different places you wouldn't expect them to.

Share this post


Link to post
Share on other sites
SimonForsman    7642

what exactly do you feel is missing, that you would like to use? While visual studio is missing quite a bit of C++11, it has a decent amount of it implemented, especially the more important bits. The other chunks and pieces that are missing aren't particularly important for most cases, doesn't mean you won't miss them though on the rare occasion.

 

There is a great deal to C++11, and no current compilers are "standards compliant," although clang makes a decent go at it.

 

 


That is minor in comparison to what is missing from Visual Studio. I have a feeling that gcc will be far better at implementing the standards than Microsoft.
 

I would consider the missing lack of a regular expressions library, part of the new standard library, to be a rather significant chunk of the C++ language to be missing. Especially since regular expressions tend to creep and find their way into so many different places you wouldn't expect them to.

 

Yeah, clang really is pulling quite far ahead of gcc now, heck, even if you ignore the C++11/C99/C11 support clangs warnings and error messages alone are a good enough reason to use it over gcc. (allthough gcc is catching up in that area aswell now)

Edited by SimonForsman

Share this post


Link to post
Share on other sites
MarkS    3502

what exactly do you feel is missing, that you would like to use? While visual studio is missing quite a bit of C++11, it has a decent amount of it implemented, especially the more important bits. The other chunks and pieces that are missing aren't particularly important for most cases, doesn't mean you won't miss them though on the rare occasion.
 
There is a great deal to C++11, and no current compilers are "standards compliant," although clang makes a decent go at it.
 
 

That is minor in comparison to what is missing from Visual Studio. I have a feeling that gcc will be far better at implementing the standards than Microsoft.

I would consider the missing lack of a regular expressions library, part of the new standard library, to be a rather significant chunk of the C++ language to be missing. Especially since regular expressions tend to creep and find their way into so many different places you wouldn't expect them to.


I don't consider STL to be part of the actual language, seeing as how it is a library based on and for the purpose of expanding the language. To that end, I have known of the existence of regex, but I had no idea exactly what it was until last week. It isn't something that I have ever used or needed. Now that I know what it is, I can find uses for it when gcc implements it, but it will not be missed in the interim. My only gripe with VS' STL implementation is that it doesn't properly implement emplace (emplace_back, et. al). All emplace does in VS is call push_back. I can do that myself!

The lists that Matt-D posted highlights some of the things that I cannot do and want to do in VS. Initializer lists, variadic templates, defaulted and deleted functions (cannot properly do move constructors without 'em) and user-defined literals to name a few. These are not part of STL and I cannot even try to use them in VS 2012.

Yeah, clang really is pulling quite far ahead of gcc now, heck, even if you ignore the C++11/C99/C11 support clangs warnings and error messages alone are a good enough reason to use it over gcc. (allthough gcc is catching up in that area aswell now)


I looked at clang before choosing gcc. There seems to be trouble coupling it with Code::Blocks (I haven't tried it myself yet) and what I forgot to add in my original post was the need for a graphical IDE. I have no allegiance to gcc, other than it can be effortlessly integrated with Code::Blocks. If someone knows how to integrate clang with Code::Blocks or if someone knows of an adequate IDE for clang, I have no problem switching. Edited by MarkS

Share this post


Link to post
Share on other sites
Chris_F    3030

It would be nice if there was some real effort to get Clang on Windows. I'd be real tempted to switch to it from GCC considering what I've seen with error messages and C++11/14 support.

Share this post


Link to post
Share on other sites
Washu    7829


I don't consider STL to be part of the actual language, seeing as how it is a library based on and for the purpose of expanding the language. To that end, I have known of the existence of regex, but I had no idea exactly what it was until last week. It isn't something that I have ever used or needed. Now that I know what it is, I can find uses for it when gcc implements it, but it will not be missed in the interim. My only gripe with VS' STL implementation is that it doesn't properly implement emplace (emplace_back, et. al). All emplace does in VS is call push_back. I can do that myself!

"STL" doesn't exist.

 

The standard library is part of the language in any non-standalone implementation of the language. As per the language standard.

 


The lists that Matt-D posted highlights some of the things that I cannot do and want to do in VS. Initializer lists, variadic templates, defaulted and deleted functions (cannot properly do move constructors without 'em) and user-defined literals to name a few. These are not part of STL and I cannot even try to use them in VS 2012.

 

As I noted previously, there are some things that are missing from VS that are useful (variadic templates is pretty high on my list), however its not actually something I find myself needing or even wanting to use in a large number of cases. You can handle move constructors perfectly fine without the use of default or deleted functions. Might not be as simple as just tacking on a default or deleted, but you can do it quite fine and easily.

Share this post


Link to post
Share on other sites
MarkS    3502

The standard library is part of the language in any non-standalone implementation of the language. As per the language standard.


When I say "part of the language", what I mean is sitting down and writing code without including any headers. Anything that you can write in this case is "the language". Anything else is an add-on.

I do get that STL is part of the design standard and considered part of C++, however, this breaks what I have always considered a computer language. I don't think anyone would argue that "printf" is part of the C language; It is part of the standard IO library. However, somehow, std::cout is considered part of C++. This is the case even though you can write entire programs and never touch STL. Granted, doing so is akin to shooting yourself in the foot just for the heck of it.

Share this post


Link to post
Share on other sites
Matt-D    1574

It would be nice if there was some real effort to get Clang on Windows. I'd be real tempted to switch to it from GCC considering what I've seen with error messages and C++11/14 support.

 

There is one, although it's non-free: Embarcadero C++ Builder XE3, http://isocpp.org/blog/2012/12/embarcadero-c-builder-xe3

Haven't had any experience with it, though.

 

 

The standard library is part of the language in any non-standalone implementation of the language. As per the language standard.


When I say "part of the language", what I mean is sitting down and writing code without including any headers. Anything that you can write in this case is "the language". Anything else is an add-on.

I do get that STL is part of the design standard and considered part of C++, however, this breaks what I have always considered a computer language. I don't think anyone would argue that "printf" is part of the C language; It is part of the standard IO library. However, somehow, std::cout is considered part of C++. This is the case even though you can write entire programs and never touch STL. Granted, doing so is akin to shooting yourself in the foot just for the heck of it.

 

 

Technically, what you're referring to is called "the C++ core language" or just "core C++" (standard C++, the core language).

Parts of STL have become incorporated into the C++ standard library (standard C++, the standard library).

This division is reflected in the ISO C++ standardization committee itself, with "core working group" (CWG) and "library working group" (LWG):

http://stackoverflow.com/questions/13221593/what-does-core-language-mean

// However, there are also WGs such as Evolution (aka EWG) or Library Evolution (LEWG) and further (sub)divisions: http://isocpp.org/std/the-committee

 

wg21-structure.png

 

Together, the C++ programming language itself is defined in the C++ standard (and a compliant implementation, whether just a compiler or an entire IDE, has to ship both the core language and the standard library in order to be considered a compliant C++ implementation).

 

Hope this clears things up ;-)

Edited by Matt-D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this