Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C++ compilers

  1. Dec 16, 2007 #1

    Kurdt

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Could anyone recommend a good C++ compiler program. I'd rather get a recommendation than choose from the myriad on the net.

    Thanks :smile:
     
  2. jcsd
  3. Dec 16, 2007 #2

    Hurkyl

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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)
     
  4. Dec 16, 2007 #3

    ranger

    User Avatar
    Gold Member

    Yup, GNU GCC is the way to go.
    http://gcc.gnu.org/
     
  5. Dec 16, 2007 #4

    Kurdt

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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.
     
  6. Dec 16, 2007 #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 nightly build (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: Dec 16, 2007
  7. Dec 16, 2007 #6

    Hurkyl

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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:
     
  8. Dec 19, 2007 #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.
     
  9. Dec 26, 2007 #8
    I would also throw in a recommendation for Vim as an editor.
     
  10. Dec 28, 2007 #9

    ranger

    User Avatar
    Gold Member

    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 thats better suited for me. Its a lightweight IDE called geany. Geany comes with a nice text editor.
    http://geany.uvena.de/
     
  11. Dec 30, 2007 #10

    zyh

    User Avatar

    visual c++ 2005 or 2008 express edition is Free to use, to learn C++, I do support microsoft's c++ compiler!
     
  12. Dec 30, 2007 #11
    I've always used gc++.
     
  13. Jan 2, 2008 #12
    Visual C++ is better for Windows programming.........but if u wanna create programs for cross platforms, GCC is the best......
     
  14. Jan 17, 2008 #13

    malawi_glenn

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
  15. Jan 17, 2008 #14

    mgb_phys

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
  16. Jan 17, 2008 #15

    KTC

    User Avatar

    Erm no. 3rd edition at the least.
     
  17. Jan 17, 2008 #16

    mgb_phys

    User Avatar
    Science Advisor
    Homework Helper

    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 langauge features had been added.
     
  18. Jan 17, 2008 #17

    KTC

    User Avatar

    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.
     
  19. Jan 18, 2008 #18

    malawi_glenn

    User Avatar
    Science Advisor
    Homework Helper

    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: Jan 18, 2008
  20. Jan 18, 2008 #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...
     
  21. Jan 18, 2008 #20

    mgb_phys

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: C++ compilers
  1. Compiler turbo c++ (Replies: 3)

Loading...