Thread: A good C compiler

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    111

    A good C compiler

    I am looking for a good offline C compiler, I'm tired of having to log into the school servers via Putty, and using the UNIX environment.

    These boards suggest Codeblocks. I am wondering how does that compare to other compilers such as Bloodshed, eclipse (yes they do have a c compiler), etc.

    I fully understand that any code I submit must compile and run in the Unix environment that my school provides.

    And since the majority of people are professionals, what is you take on VI, VIM, EMACS, meaning how common is it to use those compilers in a professional setting.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Hope is the first step on the road to disappointment.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Strahd
    These boards suggest Codeblocks. I am wondering how does that compare to other compilers such as Bloodshed, eclipse (yes they do have a c compiler), etc.
    Code::Blocks is an IDE, not a compiler.

    Quote Originally Posted by Strahd
    I fully understand that any code I submit must compile and run in the Unix environment that my school provides.
    What is the compiler that you use on your school's server? If it is gcc, then using gcc at home would be a good idea, though not essential if you write standard (or otherwise portable) code. Since you have to double check anyway, quzah's suggestion of Pelles C would also be a good choice. One of the members here, CommonTater, is of the opinion that the documentation of Pelles C is excellent, so take that into account when choosing your C compiler.

    Quote Originally Posted by Strahd
    And since the majority of people are professionals, what is you take on VI, VIM, EMACS, meaning how common is it to use those compilers in a professional setting.
    Those are editors, not compilers.
    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 2011
    Posts
    111
    TY for pointing out my misconception on editor/compiler.

    We use the GCC with a number of flags -Wall -ansi -pedantic -c -g.

    I guess my revised question would be a good editor, like how eclipse is to java (can do without the hand holding eclipse does), that allows GCC compiling

    I'm just sick of having to depend on a online connection and school servers being up, just to be able to code. I have no issues in cut and pasting or FTP my .c file up.

  5. #5
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Strahd View Post
    TY for pointing out my misconception on editor/compiler.

    We use the GCC with a number of flags -Wall -ansi -pedantic -c -g.

    I guess my revised question would be a good editor, like how eclipse is to java (can do without the hand holding eclipse does), that allows GCC compiling

    I'm just sick of having to depend on a online connection and school servers being up, just to be able to code. I have no issues in cut and pasting or FTP my .c file up.
    If you're on linux... give code::blocks a look (Google is your friend)... but any editor that can write plain text files will do.

  6. #6
    Just a pushpin. bernt's Avatar
    Join Date
    May 2009
    Posts
    426
    WRT Linux IDEs I've started using the C/C++ module in NetBeans; I've been using it for about a month now and I can say it's been quite enjoyable so far. Obviously it's not for everyone, it feels "heavier" than c::b to me, but I thought I'd put it out there as an option.
    Consider this post signed

  7. #7
    Registered User
    Join Date
    Sep 2011
    Location
    Stockholm, Sweden
    Posts
    131
    Quote Originally Posted by Strahd View Post
    TY for pointing out my misconception on editor/compiler.

    We use the GCC with a number of flags -Wall -ansi -pedantic -c -g.

    I guess my revised question would be a good editor, like how eclipse is to java (can do without the hand holding eclipse does), that allows GCC compiling

    I'm just sick of having to depend on a online connection and school servers being up, just to be able to code. I have no issues in cut and pasting or FTP my .c file up.
    Eclipse + GCC works perfectly, so that would be my suggestion. I have used Eclipse quite a lot for C development and it works very well. It also has very nice built-in debugging capabilities.

  8. #8
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by iceaway View Post
    Eclipse + GCC works perfectly, so that would be my suggestion. I have used Eclipse quite a lot for C development and it works very well. It also has very nice built-in debugging capabilities.
    It has *many* features, but keep in mind that the Eclipse CDT can be a bit quirky when using a full-fledged ide to do editing+compiling+everything else for the first time.

  9. #9
    Registered User
    Join Date
    Sep 2011
    Location
    Stockholm, Sweden
    Posts
    131
    Quote Originally Posted by manasij7479 View Post
    It has *many* features, but keep in mind that the Eclipse CDT can be a bit quirky when using a full-fledged ide to do editing+compiling+everything else for the first time.
    I completely agree. It is always useful to understand what's going on "under the hood" when it comes to the compiling/linking process, before using an IDE that does it automatically for you.

  10. #10
    Registered User Maz's Avatar
    Join Date
    Nov 2005
    Location
    Finland
    Posts
    194
    I guess choosing IDE really is a matter of taste. Most of us have propably tried a bunch of them, and then stuck with one that suits them best. Same goes with the environment in general (like operating system on development PC).

    Back when I worked in a project researching cosmic rays I fell in love with tools usable from command line. (I worked a lot with scripts etc, and using tools designed to operate via terminal was natural when using scripts). Hence I ended up chosing linux, which offers good scripting capabilities and for which the terminal usage is more natural. On linux there is plenty of free ide alternatives available. And for most distributions, those can be obtained from distributions package management repositories.

    On Linux it is I've used:
    Eclipse, QDevelop, NetBeans, code::blocks, kdevelop...
    All of which are easy to find and install.

    On Windows I've tried:
    Code Wright, MS Visual C++, Bloodshed dev, Eclipse, code::blocks, QTCreator...

    However I am one of those using vi(m) and ctags. (and yes, there are others too - even emacs users... Although majority of people I know do use some modern IDEs.)

    My point is.. Test them. Many IDEs are free to use, so it won't hurt that much. I guess trying them is only way to tell what shall be the one you like.

  11. #11
    Registered User
    Join Date
    Sep 2011
    Posts
    111
    Quote Originally Posted by iceaway View Post
    I completely agree. It is always useful to understand what's going on "under the hood" when it comes to the compiling/linking process, before using an IDE that does it automatically for you.
    One reason I was trying to avoid Eclipse, too much hand holding, this is the Java IDE. Granted the C version could be different.

  12. #12
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Quote Originally Posted by Strahd View Post
    One reason I was trying to avoid Eclipse, too much hand holding, this is the Java IDE. Granted the C version could be different.
    What do you mean by "hand holding" for an IDE? Highlighting? Intelli-sense? These are all tools to make our lives easier.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  13. #13
    Registered User
    Join Date
    Sep 2011
    Posts
    111
    Quote Originally Posted by AndrewHunter View Post
    What do you mean by "hand holding" for an IDE? Highlighting? Intelli-sense? These are all tools to make our lives easier.
    They do, if you already know what you are doing. When I was in my intro course, Eclipse would say "hey you need a function let me put that in for you" I was "ok sure go for it thank you!"

    Then came time for the test, and a valid question would be "write a function that does foo," and the grading rubric the instructor used was, a point for each correct part of the function header we got, and other points assigned to other parts. Needless to say, on the first test I lost points on the function header.

  14. #14
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    I'd always go with GCC (and the mingw or even cygwin variants for windows). It's a tool you can use on any platform - windows, linux, mac and has cross compilers for all sorts of chips and environments. I tend to shy away from IDEs these days - emacs, scons & mercurial are pretty much part of everything I do with C.

    I still use VC++ occasionally for specific windows stuff (IMO in some cases it's the best choice by far for very specific windows tasks)

  15. #15
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by Strahd View Post
    They do, if you already know what you are doing. When I was in my intro course, Eclipse would say "hey you need a function let me put that in for you" I was "ok sure go for it thank you!"

    Then came time for the test, and a valid question would be "write a function that does foo," and the grading rubric the instructor used was, a point for each correct part of the function header we got, and other points assigned to other parts. Needless to say, on the first test I lost points on the function header.
    I don't remember Eclipse pulling out functions out of a hat ever.
    If you need a function, it does not prevent you from writing every part on you own.... except maybe putting opening and closing braces for avoiding syntax errors.

    If you do not want hand holding, use a text editor for writing and the terminal for compiling.
    In that case, I'd suggest 'kate' which has a built in functionality for displaying a konsole frame.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How good is the compiler of VS .NET Pro, really?
    By lightatdawn in forum Windows Programming
    Replies: 5
    Last Post: 03-23-2004, 02:58 PM
  2. Good dos compiler
    By miclus in forum C++ Programming
    Replies: 7
    Last Post: 01-04-2004, 01:04 AM
  3. A good C++ compiler
    By Cris987 in forum C++ Programming
    Replies: 15
    Last Post: 01-02-2004, 08:42 AM
  4. Good C++ compiler for XP
    By windoze victim in forum C++ Programming
    Replies: 9
    Last Post: 03-10-2003, 02:17 AM
  5. Know a good C Compiler?
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 02-05-2002, 06:41 AM