Menu

GCC 2.95.3 with the Dev IDE.

qWake
2003-09-07
2012-09-26
  • qWake

    qWake - 2003-09-07

    This post is to provide a little relief to those who have posted a "big executable" or "slow compile" post: I share my own solution.

    Yes rumours are true, I am one of those who highly value fast compilation time.  Yes, I once used Turbo-C.  Small exec size is not as important to me as my own time is; but it is nice too and it is valued by a number of other people.  And yes, I like the speed of GCC 2.95.3 and I get frustrated from just staring tentatively at the "abort" button when compiling with a 3.x version.  I find myself walking to the coffee maker to pour myself another cup every time I compile something.  Frankly, my stomach just cannot handle all that coffee, not to mention the consequent frequent trips to the washroom (although I can also take advantage of these by starting the next compile).

    So I still use 2.95.3 for almost all development, switching back to 3.2 for a final compile only when everything is done and only when comes time to confirm adherence to the most recent standard.  This seems like the best of both worlds: rapid development first, then a final compliance check with a more current compiler.  It saves me a lot of time in addition to resulting in lower grocery bills since I don't need to buy as much coffee and toilet paper.

    If you like my approach and would like to keep using 2.95.3 then:

    1. First, install the current Dev package with the most-recent version of GCC.  You may not want to use it all the time, but you should still have it available as a good way to ensure that your code is as compliant as possible with the modern C++ standard.  And if execution speed also matters, you may need to compile your release version with it anyways.

    2. Download the binary file you need for version 2.95.3 which remains available from the MinGW site:

    http://www.mingw.org/download.shtml

    Scroll down the page to the GCC-2.95.3 section and donwload the 'bin' installation file (~4.4Mb).  Unzip this archive in a directory named gcc2953 on the same drive as where you have installed Dev-Cpp (if you want to keep things close to each other).

    3. Setup the Dev IDE to make use of this version:
    - In "Tools | Compiler Options" click the + button to add the new compiler and provide a name for this version (I suggest "GCC 2.95.3" as a sensible choice).
    - Click the "Directories" tab, then for each of the four sub-tabs modify the current listing by double-clicking the current path and replacing the path lists as follow (I have my own compiler on drive D: but of course enter whatever drive letter you are using).
    --> Binaries --> D:\gcc2953\bin
    --> Libraries --> D:\gcc2953\lib
    --> C Includes --> D:\gcc2953\include
    --> C++ Includes --> D:\gcc2953\include AND d:\gcc2953\include\g++-3

    Note that there are two (2) paths to provide for the C++ Includes.

    4. From that point on, when you create a new project, you can select from the menu "Project | Project Options", click the Compiler tab and pick the compiler you wish to use for that project.

    I hope I didn't miss anything in these instructions and that these will help some of you.  Enjoy your freedom of choice!

    qWake

     
    • Wayne Keen

      Wayne Keen - 2003-09-07

      Thanks sir,

      Wayne

       
    • Nobody/Anonymous

      Thanks for the nice post. I wanted to do this for a long time. But after I followed your directions I discovered that the gcc 2.95.3 (4.4mb) binary does NOT come with make.exe so I had to get make.exe and put it into the c:\gcc2953\bin directory in order to compile projects. However, I still end up with other resource errors saying "no resources" "error 1" so I also copied ld.exe and windres.exe to the c:\gcc2953\bin dir only to finally get an error saying ld: cannot open crt2.o : No such file or directory make.exe ***[build error] error 1

      I give up. Can anyone help me. I tried 4.9.8.0 and 4.9.8.2  with the same results. BTW if I use the default compiler everything is fine. I am just trying to compile the hello world template included with dev.

      RA

       
    • Nobody/Anonymous

      yeah, got similar problems :(

      atm he says "iostream: No such file or directory."

      i didnt try it on because i read this post above and it seems that this might take some time ;-)

       
    • qWake

      qWake - 2003-09-08

      Very sorry about this, let me try to fix it.  I had made the mistake of assuming that the currently-available MinGW 2.95.3 package had the same complete content as the one I had saved for myself quite some time ago.  But you are correct: the bin directory does not contain half of all the files that come bundled along with the Dev IDE.  My assumption has just made a proverbial ass out of me...  :(

      Here is an approach that should load all the necessary files into the gcc2953 directory.  This step replaces the unpacking of the official MinGW archive file in my original instructions (step 2).  If a brave soul can test it and report any other problem, it will be helpful to all.  First, it may be a good idea to delete the content of your gcc2953 directory if you had created one already, just to avoid possible file conflicts.  Then...

      Download the complete "Dev-C++ 5.0 beta 7 (4.9.7.0) (10 MB) with Mingw/GCC 2.95.3" available near the middle of this page:

      http://devcpp.sqad.nl/devcpp.html

      Now do a complete installation of this package.  But instead of installing it in your existing "Dev-Cpp" directory you will use directory "Gcc2953".  Also be sure NOT to replace your current Dev settings (a popup window may ask you about that) since you will not be using this version of the IDE, only its compiler.

      After installation, you can clean up a bit to retain only your pre-existing version of the IDE (or not, it's up to you):
      1. Delete the new Start menu shortcut for this redundant Dev package (right-click on the shortcut, select Delete).
      2. Delete the files listed in the root of the Gcc2953 directory, these are for the IDE.
      3. Delete all subdirectories in gcc2953 EXCEPT these four:
      3.1. gcc2953\bin
      3.2. gcc2953\include
      3.3. gcc2953\lib
      3.4. gcc2953\mingw32

      qWake

       
    • Nobody/Anonymous

      i selected the installer to install only devc++ program and mingw (so i had a bit less to delete afterwards) and i backuped the original devpp.ini, just to be sure and... yeah, it worked :-)

      thx man, you're my hero ;-)

      compile times are as fast as usually, but i'm still a bit disappointed as the binarys are a bit larger than normally... *g*

       
    • Wayne Keen

      Wayne Keen - 2003-09-08

      There has been some discussion on the GCC boards that gcc-3.2 may improve things a bit...

      I haven't bootstrapped 3.4 with MingW/Msys...I have done it with Cygwin, and it took a while to figure out how to do it..

      Wayne

       
    • Wayne Keen

      Wayne Keen - 2003-09-08

      Ooops..typo, I meant that gcc-3.4 would improve things..

      Wayne

       
    • qWake

      qWake - 2003-09-08

      Oh good, I didn't screw up too badly in the end...  Let me re-write the complete instructions in five steps now in the next post.

      Note that those who want to reduce the exec size more can still continue to use "strip" and appropriate compilation flags with that version too.  And I would not be surprised if different builds of 2.95.3 (the Dev version was 2.95.3-6 and I think the final one was 2.95.3-8) produced different sizes.  But I will not be experimenting with those other versions, I'll leave it to whoever is interested to research it.

      And yes, I certainly hope version 3.x will eventually gain some speed.  It could reduce compiled size as well, after all it was one of Stroustrup's design criteria that with C++ "you don't not pay for what you don't use".  It is absolutely possible to create a compiler that abides by this principle, although it must be a fair bit of work to implement this.  We cannot forget that GCC if FREE!!!  It's a pretty darn good product for that price.

      qWake

       
    • qWake

      qWake - 2003-09-08

      Revised instructions to add the option of using MinGW 2.95.3 with the Dev IDE:

      Step 1. First, download and install the most current Dev package with the most-recent version of GCC. You may not want to use it all the time, but you should still have it available as a good way to ensure that your code is as compliant as possible with the modern C++ standard. And if execution speed also matters, you may need to compile your release version with it anyways.

      Step 2. Next, download the "Dev-C++ 5.0 beta 7 (4.9.7.0) (10 MB) with Mingw/GCC 2.95.3" version of the Dev package (named devcpp4970-gcc295.exe) that can be obtained near the middle of this page:

      http://devcpp.sqad.nl/devcpp.html

      (Or do a Google search on the file name "devcpp4970-gcc295.exe" to locate it somewhere else on the net if that page disappears.)

      Step 3.  Do a complete installation of this package. But instead of installing it in your existing "Dev-Cpp" directory you will use directory "Gcc2953". Also be sure NOT to replace your current Dev settings (a popup window may ask you about that) since you will not be using this version of the IDE, only its compiler.

      After installation, you can clean up a bit to retain only your most current (pre-existing) version of the IDE (or not, it's up to you):
      - Delete the new Start menu shortcut for this redundant Dev package (right-click on the shortcut, select Delete).
      - Delete the files listed in the root of the Gcc2953 directory, these are for the IDE.
      - Delete all subdirectories in gcc2953 EXCEPT these four: gcc2953\bin, gcc2953\include, gcc2953\lib and gcc2953\mingw32.

      Step 4. Setup the Dev IDE to make use of this version:
      - In "Tools | Compiler Options" click the + button to add the new compiler and provide a name for this version (I suggest "GCC 2.95.3" as a sensible choice).
      - Click the "Directories" tab, then for each of the four sub-tabs modify the current listing by double-clicking the current path and replacing the path lists as follow (I have my own compiler on drive D: but of course enter whatever drive letter you are using).
      --> Binaries --> D:\gcc2953\bin
      --> Libraries --> D:\gcc2953\lib
      --> C Includes --> D:\gcc2953\include
      --> C++ Includes --> D:\gcc2953\include AND d:\gcc2953\include\g++-3

      Note that there are two (2) separate paths to provide for the C++ Includes.

      Step 5. From that point on, when you create a new project, you can select from the menu "Project | Project Options", click the Compiler tab and pick the compiler you wish to use for that project.

      qWake

       

Log in to post a comment.