Finding the Right C++ Compiler Program

In summary, the conversation discusses the best C++ compiler program and recommends options such as Microsoft's Visual Studio and the GNU Compiler Collection. The conversation also mentions the use of a good editor for source code and suggests options like xemacs, Code::Blocks, and Vim. Some individuals prefer MSVC++ for its GUI builder and debugger, while others prefer using GNU tools with Emacs as an editor. The conversation also mentions the importance of good libraries and suggests books and online resources for learning C++. The conversation concludes with a recommendation for Absolute C++ by Savitch.
  • #1
Kurdt
Staff Emeritus
Science Advisor
Gold Member
4,859
6
Could anyone recommend a good C++ compiler program. I'd rather get a recommendation than choose from the myriad on the net.

Thanks :smile:
 
Technology news on Phys.org
  • #2
If you're on a windows machine, I would recommend Microsoft's Visual Studio; it's a rather good integrated development environment.

If you don't get that, then I would recommend using the gnu compiler collection (cygwin is probably the easiest way to use the gcc on a windows machine), and getting a decent editor for editing source, such as xemacs.


(Both options are free)
 
  • #3
Yup, GNU GCC is the way to go.
http://gcc.gnu.org/
 
  • #4
I've got the GNU fortran compiler and its been quite good so I was looking at their C++ but its always good to get recommendations. I'll have a look at that microsoft one.

Thanks Hurkyl and ranger.
 
  • #5
I plug Code::Blocks for those you want to use the same IDE on both Windows and Linux (OSX too, I think). It feels like VC but it has a portability advantage. Get a recent http://forums.codeblocks.org/index.php/board,20.0.html" (not the year-old release candidate), these are quite stable now and feature-rich with lots of plug-ins. But not all plug-ins are stable; the code-completion plug-in is best left disabled for example. Since the project is open source, you can place requests for specific features or even write your own, which is cool.

EDIT: I did say "IDE" and not "compiler"... If you have a few popular compilers already installed, the program should find them and let you pick which one you want to use the first time it runs.
 
Last edited by a moderator:
  • #6
Kurdt said:
I've got the GNU fortran compiler and its been quite good so I was looking at their C++ but its always good to get recommendations. I'll have a look at that microsoft one.

Thanks Hurkyl and ranger.
Yah, if you can already use the gnu tools, then g++ is certainly a good choice.

My recommendation of MSVC was not due to the quality of its compiler (though I believe the latest versions are quite good) -- it's due to the high quality of the editor and general programming environment it provides. (In fact, when I had access to an older version, I often wrote the program in visual studio, but compiled with g++ :smile:)

I've generally had poor luck trying to use other IDE's for c++. But I've only tried a few, so don't let my experience stop you from looking at what others suggest. :smile:
 
  • #7
I'm a professional programmer with much experience on Windows/Solaris/Linux.

I agree with Kurtdt, Visual C++ has in my experience the best GUI builder/code editor/debugger -- especially the debugger which is simply the best.

But, you can do everything you need with g++ using Emacs as a code editor and debugger, even on Windows. Emacs is arguably a better code editor than Visual Studio.

The GNU compiler (g++) and the Microsoft compiler (MSVC++ or cl) are of roughly equal quality at this point, as far as I can tell. The Intel compiler, if you want to pay for it, seems to be somewhat better.

I use MSys (another way to get GNU type tools going on Windows) instead of Cygwin, with MinGW, editing and debugging with Emacs, for my personal projects and Visual Studio at work.

Another factor is libraries. In my personal projects I use a lot of open source or free software libraries for math, DSP, graphics, and such. This all works much better with MSys/MinGW.

Bottom line: For me, working in computer music with lots of freely available libraries, MSys/MinGW is the best system. But I am annoyed by how much worse the debugging is than in Visual Studio.
 
  • #8
I would also throw in a recommendation for Vim as an editor.
 
  • #9
Since everyone is throwing around recommendations for editors. I'll give mine. I've used both vim and emacs and both of these are awesome. But for the last half a year or so, I've found something that's better suited for me. Its a lightweight IDE called geany. Geany comes with a nice text editor.
http://geany.uvena.de/
 
  • #10
visual c++ 2005 or 2008 express edition is Free to use, to learn C++, I do support microsoft's c++ compiler!
 
  • #11
I've always used gc++.
 
  • #12
Visual C++ is better for Windows programming...but if u want to create programs for cross platforms, GCC is the best...
 
  • #13
I use Visual c++ 2008 express, but i want to learn more about it. Does anyone know where to find tutorials/manuals? Cheep or free.
 
  • #14
If you mean learn about the vs2008 ide then microsoft's online dos are good.
For learning C++ you really want to splash out on the "C++ Programming language" by the inventor Bjarne Stroustrup.
The 2nd ed is pretty much as good as the latest for beginners, you should be able to find it cheaply on amazon marketplace. The online C++ faqs are also usefull.
 
  • #15
Erm no. 3rd edition at the least.
 
  • #16
KTC said:
Erm no. 3rd edition at the least.
Is there that much difference? Must admit I didn't read 2ed very much - I already knew C++ when I bought it, the 3ed is nice but I didn't think many new language features had been added.
 
  • #17
C++ was first standardised in 1998. 2nd edition was first published in 1991...

There were a great deal of addition to the language during that time.
 
  • #18
mgb_phys said:
If you mean learn about the vs2008 ide then microsoft's online dos are good.
For learning C++ you really want to splash out on the "C++ Programming language" by the inventor Bjarne Stroustrup.
The 2nd ed is pretty much as good as the latest for beginners, you should be able to find it cheaply on amazon marketplace. The online C++ faqs are also usefull.

Oki thanx! I have learned some via Microsofts homepage, but really want a written guide, to make notes in etc.

C++ i know some, Iam quite skilled at Java, but want to learn C++ and fortran for my studies (physics).

And I have Absolute C++ by Savitch, which I enjoy very much =)
 
Last edited:
  • #19
I really like eclipse CDT for my c++ IDE - it integrates really nicely with minGW and QT designer for all you windows programming needs :smile:

and if you're using Linux, its pretty much the same deal, only with gcc instead of minGW, or MSYS...I think it's better then using lc - especially in its latest forms (.NET) - when you want to deploy your program it's a pain if you made it using lc - you have to make sure the msvc runtime dlls are installed, and the .net framework is in the right version... if you use minGW you only have to supply one dll, and if you're using QT for the GUI, it's another dll... plus, when you use minGW and QT you can port your code to mac, Linux, BSD and a whole bunch of other OS's...
 
  • #20
Malawi:
Arguements about which edition aside - I wanted to stress that it is better to learn C++ from the Stroustrup book rather than one of the many "c++ for java programmers" or "C++ in X minutes" type books.
The Stroustrup book is hard going if you don't have much background, but your are trying to learn a major professional programming language.

fargoth:
You don't need the .net runtime for C++ unless you are writing C++/CLI - which you shouldn't do except for trying to patch a C++/.Net system together.
The free VS doesn't statically link the runtime dll because you aren't supposed to use it for distributing finished apps, it's a learning tool.
QT or wxWidgets are great for cross paltform guis, both have slightly different styles wx is more natural if you come from windows MFC programming, QT is easier if your background is X.
 
  • #21
mgb_phys said:
Malawi:
...
QT or wxWidgets are great for cross paltform guis, both have slightly different styles wx is more natural if you come from windows MFC programming, QT is easier if your background is X.

MFC programming is a nightmare, Qt has a much better event handling mechanism, and it's really a C++ toolkit, as opposed to MFC, which is just a bad wrap around the windows API.
I haven't used wxWidgets, but if it's like MFC, I think I'm grateful for my lack of knowledge :tongue:
 
  • #22
QT isn't a pure C++ toolkit it is a set of macros that are compiled into C++ by the moc.
It (until recently) emulated widgets so never looked native and had issues with themes, it is expensive if you are shipping commercial apps. It also (IFIRC) only handles gui it doesn't provide cross platform file/network APIs.

wxWidgets uses native guis on each platform, it provides extra APIs for other cross paltform stuff but it does use MFC style macros to route events.

MFC suffers from having been invented before C++ was as a capable as it is now and so you have to do a lot with macros. It is a wrapper around the win32 api but that isn't an objection - QT is a moc/C++ wrapper around the unix C stdlib. C is a wrapper around the processor assembly language!

Both MFC and wxWidgets also provide a lot of application framework code, MVC etc. You can ignore them if you like but they do save writing it from scratch each time. I think QT4 is adding some framework support.
 
  • #23
mgb_phys said:
QT isn't a pure C++ toolkit it is a set of macros that are compiled into C++ by the moc.
It (until recently) emulated widgets so never looked native and had issues with themes, it is expensive if you are shipping commercial apps. It also (IFIRC) only handles gui it doesn't provide cross platform file/network APIs.

wxWidgets uses native guis on each platform, it provides extra APIs for other cross paltform stuff but it does use MFC style macros to route events.

MFC suffers from having been invented before C++ was as a capable as it is now and so you have to do a lot with macros. It is a wrapper around the win32 api but that isn't an objection - QT is a moc/C++ wrapper around the unix C stdlib. C is a wrapper around the processor assembly language!

Both MFC and wxWidgets also provide a lot of application framework code, MVC etc. You can ignore them if you like but they do save writing it from scratch each time. I think QT4 is adding some framework support.


QT4 has such a wide framework support... a very good file system handling, xml parsing, sql handling, activeX integration into widgets, html rendering, http and ftp clients, tcp and udp client and server, regular expressions are integrated really well into string and string list manipulation, and strings use unicode in a far better way then the strings provided by STL or MFC, there are also smart pointers, much better containers then those you find in STL, opengl rendering widget, basic scalable vector graphics, and pixmap manipulation and rendering (including pretty good anti aliasing), it even includes a movie player widget.
the next version of Qt would include phonon - for handling audio...

true, it's not pure c++, but using QT's syntax makes event handling much better through the use of slots and signals which connect to these slots, so that objects comunicate with each other in an event driven way.
it's also very easy to make it all multi-threaded because of this architecture.
 
Last edited:
  • #24
Sounds good - we looked at QT2 for an app but apart from the expense it didn't look native enough on windows and we were worried about developing/debugging on something that wasn't pure code. We went with wxWindows (as it was then) instead.

The more choices the better!
 
  • #25
I agree, the more choices the better

oh, and i forgot to mention that qt4 uses native calls on each platform, so it doesn't have that problem you mentioned about the qt2 anymore...

anyway, back to the OP, eclipse is a very good IDE, and minGW/gcc is a very good free compiler.
 

1. What is a C++ compiler program?

A C++ compiler program is a software tool used to translate human-readable source code written in the C++ programming language into machine-readable instructions. These instructions can then be executed by a computer to perform a desired task.

2. Why is it important to find the right C++ compiler program?

Choosing the right C++ compiler program is important because it directly affects the quality and performance of your code. A good compiler can optimize your code, resulting in faster execution and fewer bugs. Additionally, different compilers may have different features and compatibility with certain libraries, so it's important to find one that suits your specific needs.

3. How do I know which C++ compiler program is right for me?

The right C++ compiler program for you will depend on your specific needs and preferences. Some factors to consider when choosing a compiler include its compatibility with your operating system, the size and complexity of your project, and any specific features or optimizations you require. It's also helpful to read reviews and compare the performance of different compilers.

4. Are there any free C++ compiler programs available?

Yes, there are many free C++ compiler programs available, such as GCC, Clang, and Microsoft Visual Studio Community. These compilers are open-source and can be downloaded for free, making them a great option for students and hobbyists.

5. Can I use the same C++ compiler program for different platforms?

Yes, there are some C++ compiler programs that are cross-platform, meaning they can be used to compile code for different operating systems. However, some compilers may be specific to a certain platform, so it's important to check the compatibility before using a compiler for a different platform.

Similar threads

Replies
6
Views
1K
  • Programming and Computer Science
Replies
29
Views
2K
  • Programming and Computer Science
Replies
17
Views
1K
  • Programming and Computer Science
Replies
14
Views
2K
  • Programming and Computer Science
2
Replies
65
Views
2K
  • Programming and Computer Science
Replies
20
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
6
Views
1K
  • Computing and Technology
Replies
6
Views
1K
  • Programming and Computer Science
Replies
27
Views
4K
Back
Top