#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    23
    Rep Power
    0

    Bloodshed C++ compiler


    I hope this is in the right section, I dont see a section devoted to IDE's.

    With that said I would like to use g++ as my compiler in Bloodshed instead of the default gcc. I'm told g++ is a little stricter and would like to run some code through it and see the differences.

    There is a pull down menu in compiler options but it is not obvious (to me) how to change the compiler. Im using version 4.9.9.2. Ive searched the internet but I honestly cant find a straightforward answer.

    Anyone know off hand how to change this? I appreciate any assistance.
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,377
    Rep Power
    1871
    The last supported OS for Bloodshed was Windows2000.

    http://www.microsoft.com/express/Downloads/ (but won't do C99)
    http://www.smorgasbordet.com/pellesc/
    http://www.codeblocks.org/
    http://sourceforge.net/projects/orwelldevcpp/ (but also uses the same/similar GCC to codeblocks)

    > With that said I would like to use g++ as my compiler in Bloodshed instead of the default gcc.
    > I'm told g++ is a little stricter and would like to run some code through it and see the differences.
    Did they also tell you that g++ is for compiling C++ programs, and not C programs?
    Every valid C program is NOT a valid C++ program - there are differences

    The easy way to get something to compile as C++ is to name your program prog.cpp to begin with.
    Last edited by salem; February 21st, 2013 at 03:58 AM.
    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
  4. #3
  5. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,109
    Rep Power
    1802
    Last I used Dev-C++ I believe that it used g++ automatically for C++ projects.

    Either way, there is in fact no difference between gcc and g++ other than by default g++, links C++ libraries, whereas with gcc you would have to explicitly link those libraries.

    It is not about g++ being more strict that gcc, but rather that the C++ language has stricter rules about what is valid code. Both gcc and g++ can use either C or C++ compilation.

    You can force gcc to perform C++ compilation (or even g++ to performs C compilation) regardlless of the file extension with the -x c++ command line option.

    Either way, if stricter checking is what you are after, first at least try compiling with -Wall -Werror, the semantics of C++ code are not identical to C, so if you just want stricter checking, but still want C code, that is possibly the better approach. That said, I would rather recommend embracing C++ fully in any case.

    Another issue is that Bloodshed has not maintained Dev-C++ since 2005, you would do well to switch to Orwell Dev-C++ which is the currently maintained fork or Dev-C++. That said, unless they have fixed the abysmal and useless debugger interface, I would suggest Visual C++ Express instead, or Code::Blocks if you want to use GCC/G++ specifically

IMN logo majestic logo threadwatch logo seochat tools logo