Qbasicnews.com

Full Version: Can anyone reccommend a good C/C++ compiler?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The title pretty much says it all... I'm looking at Dev C++ right now, and it's looking pretty good-- but I'm wondering if there's anything out there that people have found useful.
Dev-C++ isn't a compiler; it's an IDE that uses the mingw port of gcc for Windows. If you want to compile Windows code and use open-source software, this compiler is the way to go. If you would like to compile DOS programs, I would highly recommend DJGPP, a port of gcc to DOS by DJ Delorie. (See http://www.delorie.com/djgpp/ for download, etc.) If you want a top-notch IDE and all that MS-specific jazz (MFC, ATL, and so on), you should probably pick Microsoft Visual C++ (which can also be acquired as part of Visual Studio). Or, if you're looking for the fastest, most optimized code around, choose the Intel C++ compiler. Actually, though, recent versions of gcc have reached approximately the same level of optimization as the Intel compiler (if not better), plus the Intel compiler is relatively expensive.
Well, besides Dev-C++, there's:

1. MinGW Developer Studio
http://www.parinya.ca/mingwstudio.html
Pro: Free, roughly a clone of MS Visual Studio 6. When you type a function's name and then (, a popup displays help on the parameters.
Con: uses gcc (the GNU C compiler), which compiles very slowly and doesn't optimize as well as other compilers (Dev-C++ and this are just different IDEs for the same compiler)

2. OpenWatcom
http://www.openwatcom.com/
Pro: Free, possibly faster than MinGW/gcc. Advanced inline assembler support (you can tell the compiler to pass parameters to asm macros in whatever registers you want, etc).
Con: IDE is a bit clumsy and not very modern.

3. Intel's C++ compiler (DrV mentioned this one)
http://www.intel.com/software/products/c...n/eval.htm
Pro: Free for noncommercial use on Linux, 30 day trial for Windows. This and MS Visual C++ are considered to be the fastest C++ compilers.
Con: You have to jump through a lot of hoops to get a free copy/trial, including registering at intel.com, etc. And you don't get an IDE. It works with MS Visual Studio, if you have it.

4. MS Visual C++ Toolkit 2003
http://msdn.microsoft.com/visualc/vctoolkit2003/
Pro: Previous free versions of MS's Visual C++ compilers were crippled by removing their ability to optimize. But this free download is the exact same complete C++ compiler that comes with Visual Studio 2003.
Con: You have to compile your programs from the command line, no IDE is included.

5. Borland C++ Builder
http://www.borland.com/products/download...ilder.html
I don't know anything about it. It looks like you can get the command line compiler for free if you register. EDIT: Free third party IDE, available here

Here is a more extensive list of free compilers with descriptions.

If you decide to use a command line compiler with no IDE, I'd recommend ConText for a source code editor. Here's a list of other editors.

EDIT: Fixed a grammar mistake
I personally recommend the Borland C++ Compiler. but to be perfectly honest, the only other compiler-related thing i have used in the past was the DevC++ 4.
Quote:4. MS Visual C++ Toolkit 2003
http://msdn.microsoft.com/visualc/vctoolkit2003/
Pro: Previous free versions of MS's Visual C++ compilers were crippled by removing their ability to optimize. But this free download is the exact same complete C++ compiler that comes with Visual Studio 2003.
Con: You have to compile your programs from the command line, no IDE is included.
Anyone know if i can just install this into my Visual Studio .net (not 2003) folder, and use it with the slightly older IDE?


And lets not forget the Relo IDE or Visual Mingw, both of which you can find easily via google.
i myself use dev-c++. yes, it compiles slowly, but other than that, i've really encountered no problems. but what do i know? i know enough c++ to fit on the head of a pin...
Quote:Well, besides Dev-C++, there's:

1. MinGW Developer Studio
http://www.parinya.ca/mingwstudio.html
Pro: Free, roughly a clone of MS Visual Studio 6. When you type a function's name and then (, a popup displays help on the parameters.
Con: uses gcc (the GNU C compiler), which compiles very slowly and doesn't optimize as well as other compilers (Dev-C++ and this are just different IDEs for the same compiler)

I use both Dev-C++ (v 4.9.8.7) and MinGW Developer Studio. While both of these use the windows port of gcc, they do not produce identical compiled code. I generally use dev-c++ for writing/testing for a number of reasons mostly related to convenience features of the program. For example, Dev-c++ allows you to "drop" files onto the application to open them...while MinGW doesn't. HOWEVER, when I go to do a final compile, I do it in MinGW D-S...the code runs about 35% faster (compiled with the "optimize more" compiler flag) compared to the same code compiled using Dev-C++. I believe the difference is that Dev-C++ uses gcc v 3.2, while MinGW uses v 3.3.

As an aside, gcc v3.4 was recently released...but it has not, to my knowledge, been compiled for Windows yet. Rumor has it that Version 5 of Dev-C++ will use gcc v3.4, which could kill the speed advantage that MinGW developers studio currently holds over Dev-C++.

My observation about the speed of compiled code is measurable and the 35% is accurate for my code. Also worth commenting on (although I haven't measured it) is that MinGW D-S seems to me to build substantially faster than Dev-C++. (OK...I just measured...21 secs for a build of an 11 translation unit project on MinGW D-S vs about 38 secs to build on Dev-C++)

Although I really like the Dev-C++ IDE, the slow executables/longer build times are somewhat bothersome.
Other compiler that i'm aware of is LCC. It's small, fast, but hasn't c++ support (no templates, no classes).

It's a C compiler. Nice to play for a while.
Quote:As an aside, gcc v3.4 was recently released...but it has not, to my knowledge, been compiled for Windows yet. Rumor has it that Version 5 of Dev-C++ will use gcc v3.4, which could kill the speed advantage that MinGW developers studio currently holds over Dev-C++.
Um...... your not required to use the default compiler included with devc++........... And updating is as simple as extracting the latest mingw binaries into the mingw folder? There should be no speed difference, they use the same compiler. Change your optimization flags if you want it to compile a lot faster.

Also dev-c++ supports multiple compilers at the same time. I have it set to use devc++ 2.9.5 for smaller binaries, and also the one that ships by default.
Quote:
Quote:As an aside, gcc v3.4 was recently released...but it has not, to my knowledge, been compiled for Windows yet. Rumor has it that Version 5 of Dev-C++ will use gcc v3.4, which could kill the speed advantage that MinGW developers studio currently holds over Dev-C++.
Um...... your not required to use the default compiler included with devc++........... And updating is as simple as extracting the latest mingw binaries into the mingw folder? There should be no speed difference, they use the same compiler. Change your optimization flags if you want it to compile a lot faster.

Actually...the 3.4 version hasn't made it to Mingw yet. While it should be possible to get 3.4 working, it is by no means trivial. Also, the speed difference is real...I have measured it, and both compilers were set to no debug info, no exception handling, the -O2 optimization, and the file "stripped". The 3.3 version (MinGW D-S) performs about 35% faster on my test code than the 3.2 version (Dev-C++ 4.9.8.7).

If you know a way to get 3.4 working with either IDE, I'm all ears.

Cheers