Thread: compiler

  1. #1
    Registered User
    Join Date
    Jan 2010


    I'm not new to programming but I been switching between a couple of different compiler for C++ and was jw if there a big difference on which one you use, and if so what is a good compiler?

    Thanks for the help

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    Common to all:
    - they all implement the C++ language; most of the modern and popular ones like visual studio and GCC make a pretty good job of this.
    - they all implement the standard library.

    Where the differences lie are in:
    - additional libraries for the OS
    - additional "IDE" tools like editor, debugger, help system etc.

    If you learn C++ (that is, what the language will guarantee for you, and not what any particular compiler will let you get away with), then writing portable code, and moving from one compiler to another is pretty easy.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Join Date
    Oct 2007
    Inside my computer
    What separates most compilers is usually speed and/or code quality (often optimizations).
    Otherwise, as Salem points out, writing standard C++ code should allow you to compile your code on any given C++ compiler. So it's just a matter of opinion.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Registered User
    Join Date
    Sep 2004
    Quote Originally Posted by onymousillusion View Post
    what is a good compiler?
    Can't recommend a compiler without knowing what OS you use.
    bit∙hub [bit-huhb] n. A source and destination for information.

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Nowadays, the situation with the big compilers is this:
    Microsoft C++ (as in Visual Studio): Very fast in compilation, produces average to good code, good standard compliance (accepts pretty much all valid code), but often too lenient (accepts some invalid code), which can lead to problems if you start developing with this compiler and later want to port to others. Available for free via the Express editions of VS.
    Intel C++: Extremely slow compilation, unstable. Often crashes or miscompiles (at least that's our experience here at work), but when it works, its code is considerably faster and usually smaller than what MSC produces. Excellent standard compliance, being based on the EDG frontend. Only the Linux version is free.
    GCC: Average compilation times with high memory use, generally produces very good code. For AMD CPUs or one-size-fits-all solutions, a better choice than Intel's compiler, which is obviously biased. Excellent standard compliance. The Windows version is missing some MS extensions that mean that it's not a drop-in replacement for many Windows applications.
    CodeGear C++: Formerly Borland C++ builder. Little activity recently, although there has been a new release. I don't have much experience with it, but it's generally reputed to have extremely fast compilation, but a rather low code quality. Good standard compliance. As with GCC, it uses its own conventions, which make it unsuitable as a drop-in replacement.

    Other compilers that are not as widely used:
    Sun C++ and HP C++: these are pretty much special-purpose compilers for their respective platforms (Solaris and HP-UX).
    Clang: Still work-in-progress, its C++ support is not yet at a level where it can be used for most applications. I believe we got groff to compile. Where the standard is implemented, compliance is high and strict.
    All the buzzt!

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiler Paths...
    By Cobra in forum C++ Programming
    Replies: 5
    Last Post: 09-26-2006, 04:04 AM
  2. C Compiler and stuff
    By pal1ndr0me in forum C Programming
    Replies: 10
    Last Post: 07-21-2006, 11:07 AM
  3. I can't get this new compiler to work.
    By Loduwijk in forum C++ Programming
    Replies: 7
    Last Post: 03-29-2006, 06:42 AM
  4. how to call a compiler?
    By castlelight in forum C Programming
    Replies: 3
    Last Post: 11-22-2005, 11:28 AM
  5. Bad code or bad compiler?
    By musayume in forum C Programming
    Replies: 3
    Last Post: 10-22-2001, 09:08 PM