View Full Version : What compiler do you use and why?
justdan
06-12-2006, 05:38 PM
I was just wondering if I should switch compilers as I'm using microsoft studios now for c++ but I've heard some bad things about it, yet not having any experience with other compilers I don't know what these bad things are. Anyone care to offer the compiler they're using as a substitute?
Reedbeta
06-12-2006, 07:09 PM
I've used Visual Studio (7.1; haven't made the leap to 8.0 yet) for several years of hobby development, and I've never had any major problems with it. The IDE is pretty nice; it's very convenient to have all the compiler options configurable using a series of dialog boxes, and the VS debugger is a very fine piece of work.
The main other C++ compiler (family) that you will run into sooner or later is gcc (http://gcc.gnu.org/), aka mingw (http://www.mingw.org/) on Windows platforms. It's a command-line tool; there are IDEs available that wrap it, like DevC++ (http://www.bloodshed.net/devcpp.html) and Code::Blocks (http://www.codeblocks.org/), though I haven't used the IDEs. If you wanted, you could use the Visual Studio IDE and compile with gcc, or use one of the free IDEs and compile with the Microsoft compiler. However you can't use the Visual Studio debugger with gcc; you'll have to use gdb (http://www.gnu.org/software/gdb/) or ddd (http://www.gnu.org/software/ddd/) for that (don't you just love all these TLAs (http://en.wikipedia.org/wiki/TLA)? ;))
Which set of software (Microsoft vs GNU) you decide to use is largely a matter of taste, past experience, finances, and political views; however, within my experience I'd point out the following differences between them:
* VS has a lot of "extensions" to C++ in its compiler that enable users to write not-quite-standards-compliant programs (for instance, the infamous for loop scope conformance issue (http://www.igda.org/Forums/showthread.php?postid=60829), though newer versions of VS are better about this). On the other hand, gcc tends to be "fussier" (read: more adherent to the Standard) about these things, and often produces a variety of warnings that VS will not produce even on the highest warning level. Another thing gcc can be fussy about is templates (http://www.devmaster.net/forums/showthread.php?t=5865).
* VS is generally better at optimization. As an anecdote, a raytracer I wrote once (heavy use of floating-point operations) rendered an image over 3 times faster when compiled with VS than when compiled with gcc, on the same machine.
(don't you just love all these TLAs (http://en.wikipedia.org/wiki/TLA)? ;))
Interestingly, TLA is not an acronym (http://en.wikipedia.org/wiki/Acronym) ;-)
justdan
06-12-2006, 07:46 PM
I've tried visual studios 8 and didn't like it that much I'll have to try 7 though, using 6 now.
SamuraiCrow
06-12-2006, 09:11 PM
I always use GCC since I don't want to be locked into just writing Windows software the rest of my natural born days.
Almos
06-13-2006, 12:03 AM
Same as SamuraiCrow.
Visual Studio 2005 for me. I haven't found anything yet that compares to it.
I agree with Nick. And the Express Edition is free :)
And I agree with moe and Nick :)
* VS is generally better at optimization. As an anecdote, a raytracer I wrote once (heavy use of floating-point operations) rendered an image over 3 times faster when compiled with VS than when compiled with gcc, on the same machine.
I'll bite.
For my SSE raytracer, with both automatic scalar codegen & intrinsics paths, taking msvc8 as the baseline rendering is at least 25% faster with gcc (icc 9.1 is a couple of percent slower) on xp32; it's even worse for kd-tree construction which is more about memory/pointer manipulations than fp computations.
It's no surprise as msvc8 spits branches like there's no tomorrow, a no no for performance even on a k8.
And it didn't happen overnight, it has been that way for a couple of years (note that icc used to produce slightly faster 32bit code than gcc).
So, i'll dare to suggest you to revise your coding style.
Now there's no doubt msvc integrated visual debugger is unmatched - if a bit bloated -.
EDIT: note that it takes like 10 lines of perl to transmogrify gcc's warnings & errors into something that mscv IDE groks.
Visual Studio 2005 for me. I haven't found anything yet that compares to it.
Same here.
VS has a lot of "extensions" to C++ in its compiler that enable users to write not-quite-standards-compliant programs (for instance, the infamous for loop scope conformance issue (http://www.igda.org/Forums/showthread.php?postid=60829), though newer versions of VS are better about this). On the other hand, gcc tends to be "fussier" (read: more adherent to the Standard) about these things
Heh, I used to think the opposite... gcc has a metric ton of extensions (general and platform-specific); with C++/CLI, things are, heh, muddier. Gcc is quicker to include any additions and changes to the standard.
Visual Studio 2005 is a true gem of an IDE. I had a hard time swallowing the first .NET IDE, but it has evolved into an incredibly intuitive and powerful tool.
kusma
06-13-2006, 01:46 PM
I use MSC, GCC or ARM RDS, all depending on the type of project I'm working on.
SmokingRope
06-13-2006, 02:35 PM
Visual Studio 2005 is a true gem of an IDE.
Although 've had some issues with the form designer; Visual Studio's UI has been blindingly fast compared to Eclipse. I've yet to come to terms with vim or emacs making it just about the only way to develop.
eddie
06-13-2006, 04:06 PM
Personally, I use Visual Studio as my IDE on windows, VIM is my all purpose IDE on other things.
I make Visual Studio pop up a GVIM app for files that Visual Studio doesn't handle so nicely however, which is quite handy. For instance, at work I use it to deal with UnrealScript code, which I get no real benefit out of using the VisualStudio IDE.
Wernaeh
06-14-2006, 04:40 AM
Visual Studio 2005 for me. I haven't found anything yet that compares to it.
Dito.
Cheers,
- Wernaeh
vBulletin, Copyright ©2000-2010, Jelsoft Enterprises Ltd.