Thread: Compiling Simple Programs- Use What Compiler?

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    127

    Question Compiling Simple Programs- Use What Compiler?

    I bought a book recommended on here a while ago, C++ Without Fear, and basically there are a load of simple programs in it that you type out and run. I downloaded MS Visual C++ Express, but it seems like every time you want to type in a simple program you have to screw around starting an entire project etc.

    So I'm wondering:

    1. Do you think it would be better to use a different program to build the programs from the book?
    2. If so, which is the best free one to use? I used to used Bloodshed but it stopped working.
    3. If not, how can I configure Visual C++ Express so that it's less hassle to build the programs through it? I don't want to keep messing around starting new projects each time.

    Thanks for your help.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Visual studio works with projects - that's how it is.

    You can use command-line compilation if you want, but that means no "click on error to jump to the location in the code".

    Or, for simple projects, what I often do, is to have a project "scratch" that I replace the contents of "scratch.cpp" file with whatever code I want to try out. You can always use "save as" or "copy"[on the command line] to save away an existing excercise for looking at later. So you alway compile the same "scratch.cpp" each time, but with completely different content.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    1. Do you think it would be better to use a different program to build the programs from the book?
    Not necessarily. The compiler provided with the MS Visual C++ 2005 Express is reasonably standards conformant.

    2. If so, which is the best free one to use? I used to used Bloodshed but it stopped working.
    Bloodshed's Dev-C++ is an IDE that uses the MinGW port of GCC for its compiler toolchain. If you are concerned with the halt in Dev-C++ development, you can continue to use the MinGW port of GCC (e.g., the g++ compiler for C++) at the command line, via the MSYS shell (also provided by the MinGW team), or with some other free IDE, e.g., Code Blocks or even Eclipse and Netbeans.

    but it seems like every time you want to type in a simple program you have to screw around starting an entire project etc.

    3. If not, how can I configure Visual C++ Express so that it's less hassle to build the programs through it? I don't want to keep messing around starting new projects each time.
    You can setup a project and use it over and over again to compile and run the examples.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Registered User
    Join Date
    Sep 2007
    Posts
    127
    Thanks, guys. I'm compiling stuff in VS by setting up a scratch project now and it works great.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. compiling and executing issue with lcc win32
    By GanglyLamb in forum C Programming
    Replies: 10
    Last Post: 12-22-2004, 02:24 PM
  2. Newbie: Huge EXE files for simple programs - why?
    By Dominic in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 10-11-2002, 04:07 PM
  3. Bad code or bad compiler?
    By musayume in forum C Programming
    Replies: 3
    Last Post: 10-22-2001, 09:08 PM
  4. Need help with simple programs...
    By BCole19 in forum C++ Programming
    Replies: 22
    Last Post: 08-30-2001, 09:45 PM
  5. Problem with Borland 5.5 Compiling Windows Programs
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 08-28-2001, 09:04 AM