Thread: C Compilers

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    1

    C Compilers

    I am new to C and I literally mean new. I just bought a book and am in Chapter 1. To do any pogramming, however, will need a C compiler. Does anyone have any recommendations on a good choice for one? Thank you. Your help is appreciated.

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    VC++ on Windows or gcc on UNIX.
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    30
    Bloodshed Software - Dev-C++

    Here's one at no cost, its a Windows front end for GCC/G++

  4. #4
    DESTINY BEN10's Avatar
    Join Date
    Jul 2008
    Location
    in front of my computer
    Posts
    804
    Quote Originally Posted by mark98 View Post
    I am new to C and I literally mean new. I just bought a book and am in Chapter 1. To do any pogramming, however, will need a C compiler. Does anyone have any recommendations on a good choice for one? Thank you. Your help is appreciated.
    Search the forum, you'll find a lot of suggestions. Choose whichever suits your needs.
    HOPE YOU UNDERSTAND.......

    By associating with wise people you will become wise yourself
    It's fine to celebrate success but it is more important to heed the lessons of failure
    We've got to put a lot of money into changing behavior


    PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
    IDE- Microsoft Visual Studio 2008 Express Edition

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    code::blocks is a better alternative to bloodshed
    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.

  6. #6
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Quote Originally Posted by shiryu3 View Post
    Bloodshed Software - Dev-C++

    Here's one at no cost, its a Windows front end for GCC/G++
    Please no...it's NO LONGER SUPPORTED OR UPDATED!

  7. #7
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    My #1 recommendation to newbies is to use a syntax highlighting text editor (eg, notepad++ on windows, or anything on linux) and then just use the compiler on the command line, and not an IDE like code::blocks.

    Which is to say, you should understand that the compiler IS NOT a graphical program with menus and windows, etc, it is just a command:

    gcc mycode.c

    If you are on linux, you almost certainly want to use gcc. I don't program on windows, but I believe if you install Visual Studio, you can still use the compiler on the command-line:

    How to: Invoke the Command-Line Compiler

    Of course, if really want to use the "IDE" (integrated development environment) that is Visual Studio, you can. But IMO these things are intended to make things easier for the proficient, and not the beginner, for whom they will probably just be a complication.

    Also, doing things "the old fashioned way" may give you some insight you would not get otherwise.

    Just an opinion to make you aware of the alternatives
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  8. #8
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Quote Originally Posted by MK27 View Post
    My #1 recommendation to newbies is to use a syntax highlighting text editor (eg, notepad++ on windows, or anything on linux) and then just use the compiler on the command line, and not an IDE like code::blocks.

    Which is to say, you should understand that the compiler IS NOT a graphical program with menus and windows, etc, it is just a command:

    gcc mycode.c

    If you are on linux, you almost certainly want to use gcc. I don't program on windows, but I believe if you install Visual Studio, you can still use the compiler on the command-line:

    How to: Invoke the Command-Line Compiler

    Of course, if really want to use the "IDE" (integrated development environment) that is Visual Studio, you can. But IMO these things are intended to make things easier for the proficient, and not the beginner, for whom they will probably just be a complication.

    Also, doing things "the old fashioned way" may give you some insight you would not get otherwise.

    Just an opinion to make you aware of the alternatives
    Seconded. I use a Scintilla-based editor and mingw gcc from the command line. For compilicated projects, makefiles and batch scripts can simplify things, as well.

  9. #9
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Just wanted to third this. While I use VS when developing on Windows, to just view code quickly I use whatever syntax-highlighting editor I happen to have around, and that's usually SciTE.

  10. #10
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    Using an IDE makes it more convenient to step through your code in the debugger, as the debugger can use the actual editor, instead of printing lines out of context.

    It can also display the directory tree structure, which is convenient for a large project.

    And most important for a beginner, it makes it easier to start, because it decides all the compiler flags for you, and you don't have to worry about make files.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  11. #11
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    Just wanted to third this. While I use VS when developing on Windows, to just view code quickly I use whatever syntax-highlighting editor I happen to have around, and that's usually SciTE.
    Fourthed.

    Elysia will jump in any second now .

  12. #12
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    I use SciTE and Dev-C++ on Windows (though if I had to write any major projects I think I'd use Code::Blocks). And vim and KDevelop with gcc/g++ on Linux.

    For what it's worth: SourceForge.net: Integrated Development Environment - cpwiki
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  13. #13
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Sigh. Damn command-line inVOkers. Evil, anti-noob unfriendly.
    Go with a real IDE that handles everything for you. Visual Studio is one such.
    One button to compile all your source files, no worrying about command line flags and stuff. Default settings are fine (although warning level really should be raised).
    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.

  14. #14
    Registered User
    Join Date
    Aug 2009
    Posts
    198
    I think that command-line is orders of magnitude easier that Visual Studio. It was so difficult to figure out and memorize those menus, that I just couldn't take it. I actually never figured out debuggers, linking, libraries but when I got Linux and gcc/gdb, it was a piece of cake!

    You *WILL* Learn C Faster And Painlessly With Command Line Tools! (and Linux really helps)

    What would you rather do:
    Not being able to figure out having multiple source files, or just type a list of your files.
    Go through tedious senseless menus and find some obscure files, or just type the name or you library!
    Have this big folder with project files and all these pointless directories, or just a source file and and output file!
    Having trouble figuring out debug and release mode, here just type a key.

    In fact Visual Studio was so difficult, that I quit C/C++. When I got Linux, and heard it has "gcc" in it, I can finally write C painlessly!
    Last edited by MTK; 09-18-2009 at 06:29 PM.

  15. #15
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    Evil, anti-noob unfriendly.
    That's a double negative. So I see you agree.

    The problem with just need to press a button is... finding where the button is.

    I'd say "gcc a.c" is easier. Even if you can't figure that out yourself, "gcc --help" as per the UNIX conventions will give you a 54 lines short help. The first line of which says
    Usage: gcc [options] file...
    and this is also following the conventions.

    Of course, I am assuming the user is familiar with the command line. Note that being a C newb isn't the same thing as a computer noob. In fact, most aren't. And most true computer-not-noobs are at least comfortable with the command line (even if they don't prefer it).

    What you said could be true if the person is deathly afraid of the command line, but it has nothing to do with command line compilation being more difficult.

    It's like saying riding a bike is more difficult than driving a car because you can't ride a bike.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ Builder Comparison
    By ryanlcs in forum Tech Board
    Replies: 14
    Last Post: 08-20-2006, 09:56 AM
  2. Other compilers
    By OldSchool in forum C++ Programming
    Replies: 6
    Last Post: 06-10-2006, 09:15 PM
  3. Is It Possible To Install Multiple Compilers?
    By mishna_toreh in forum C Programming
    Replies: 3
    Last Post: 05-13-2005, 07:32 AM
  4. Compilers for Windows
    By LegendsEnd in forum Windows Programming
    Replies: 2
    Last Post: 03-26-2004, 08:03 AM
  5. Compilers, Compilers, Compilers
    By Stan100 in forum C++ Programming
    Replies: 11
    Last Post: 11-08-2002, 04:21 PM