Compiler

This is a discussion on Compiler within the C Programming forums, part of the General Programming Boards category; I just need a Windows C compiler. I need something that I can install that can put a function into ...

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    23

    Compiler

    I just need a Windows C compiler. I need something that I can install that can put a function into the command line and I can type in a command from anywhere in the command line prompt and compile a program. I was really rambly, there.

  2. #2
    Registered User mdj441's Avatar
    Join Date
    Aug 2011
    Location
    NYS, USA
    Posts
    18
    You mean something where you can just
    Code:
    compiler mycode.c -o myprog.exe
    ?

    Though most people would recommend Visual Studio or Pelles C, you might consider TCC if you're just looking for a simple, easy-to-use command line compiler.
    You could also look up MinGW/gcc, which are more popular and probably more useful in the long run.

    Whatever compiler you pick, though, all you have to do is add the directory it's in to your PATH environment variable to be able to use it from anywhere (something like Control Panel->System->Advanced->Environment Variables).

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Gigabitten View Post
    I just need a Windows C compiler. I need something that I can install that can put a function into the command line and I can type in a command from anywhere in the command line prompt and compile a program. I was really rambly, there.
    Trust me on this... you're gonna get real tired of working from the command line real fast... You will begin to crave an IDE with syntax highlighting and such very early in the process. You will also want the convenience of button click compile and run as well as the benefits of customized editors and such.

    Go get yourself Pelles C... either 32 or 64 bit version, as appropriate to your version of Windows. As soon as you install it, open the help file... you will find it has both a wonderful IDE and a comprehensive set of command line tools as well.

    But I'd bet real money you won't be doing command line compiles after you see what the IDE can do for you.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    Later on, CT will complain that you jumped to IDE's too soon, because they hide all sorts of implementation detail about how compilers and linkers work.

    This will come to the fore when you ask how to add a library to your project (which is falling off a log easy from the command line, but can be an obscure PITA within an IDE).
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Salem View Post
    Later on, CT will complain that you jumped to IDE's too soon, because they hide all sorts of implementation detail about how compilers and linkers work.

    This will come to the fore when you ask how to add a library to your project (which is falling off a log easy from the command line, but can be an obscure PITA within an IDE).
    What is your problem?
    You having a fight with the wife and taking it out on me or something?

    GEES!


    Most IDEs make adding libraries painfully simple... in Pelles you just list it on the linker tab and add it's path to the linker's path... easier, in fact, than doing it from the command line.

  6. #6
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    Most IDEs make adding libraries painfully simple... in Pelles you just list it on the linker tab and add it's path to the linker's path... easier, in fact, than doing it from the command line.
    Really?

    Code:
    gcc ... -lmylibrary

  7. #7
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by cyberfish View Post
    Really?

    Code:
    gcc ... -lmylibrary
    Really... In the IDE I add it once and it's saved with the project settings. As I work through my project doing test compiles and debugging, I only need to click the "build" or "run" button and it's all nicely done for me. From the command line you get to type that and considerably more alphabet soup *every time you compile the program*... thousands of times for some more complex projects.

    Yes I know about makefiles. No I don't shy away from using them... It's just that with a proper IDE you don't need them!

    An IDE is a tool, just like any other. It helps you accomplish certain tasks... Given the benefits of syntax highlighting, brace matching and more... there's no good reason not to use one... well except for the old-school snobbery about "real programmers" ... This notion that a trade should involve hardship is beyond silly.

    @Salem .... well done! You've managed to set off one of the oldest and stupidest debates in programming...
    Last edited by CommonTater; 12-06-2011 at 08:41 AM.

  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,717
    Quote Originally Posted by CommonTater
    Really... In the IDE I add it once and it's saved with the project settings. As I work through my project doing test compiles and debugging, I only need to click the "build" or "run" button and it's all nicely done for me. From the command line you get to type that and considerably more alphabet soup *every time you compile the program*... thousands of times for some more complex projects.

    Yes I know about makefiles. No I don't shy away from using them... It's just that with a proper IDE you don't need them!
    On the other hand, with suitable command shell, a text editor suitable for programming (with syntax highlighting, brace matching and more), a debugger, makefiles/build scripts and other tools, you don't need an IDE... although in reality what happens is that the whole command line-based development environment setup has been custom integrated by the developer to become an IDE that isn't called an IDE
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  9. #9
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by laserlight View Post
    On the other hand, with suitable command shell, a text editor suitable for programming (with syntax highlighting, brace matching and more), a debugger, makefiles/build scripts and other tools, you don't need an IDE... although in reality what happens is that the whole command line-based development environment setup has been custom integrated by the developer to become an IDE that isn't called an IDE
    Like you said... it's not called an IDE but that is what it amounts to.

    POIDE is one of the big reasons I've stuck with Pelles C all these years... it's a definate keeper, very complete.

    But then, those who do everything at the command line are welcome to it...
    I suppose there are masochists who pound code and that would be right up their alley...

  10. #10
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    No, there are far more stupid debates you can get involved in if you want.

    And FWIW, knowing how the tool chain works under the hood is really important to know.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  11. #11
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Salem View Post
    No, there are far more stupid debates you can get involved in if you want.

    And FWIW, knowing how the tool chain works under the hood is really important to know.
    And you think that using a convenient tool somehow magically prevents people from understanding?


    So in reality this...
    Quote Originally Posted by Salem
    Later on, CT will complain that you jumped to IDE's too soon, because they hide all sorts of implementation detail about how compilers and linkers work.
    Should have read... "Later on I will complain..."

    You're one very strange dude my friend...
    Last edited by CommonTater; 12-06-2011 at 11:28 AM.

  12. #12
    Registered User
    Join Date
    Nov 2011
    Posts
    23
    Geez! I left for one day and you already have a full-on debate going! Not bad! Thanks for the tips, guys.

  13. #13
    Registered User
    Join Date
    Nov 2011
    Posts
    23
    By the way, how do you mark a thread as solved?

  14. #14
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    We don't usually do that here, but maybe change the thread title? (can you even do that?)

  15. #15
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,239
    Nothing wrong with an IDE, it's just that if your code is only buildable from the IDE then it's only as portable as the IDE.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 12-13-2010, 09:02 PM
  2. Replies: 4
    Last Post: 09-12-2009, 01:10 PM
  3. Replies: 2
    Last Post: 02-04-2008, 01:34 AM
  4. hp iPAQ 6300 && C compiler || C# compiler
    By xddxogm3 in forum Tech Board
    Replies: 2
    Last Post: 12-07-2004, 06:28 AM
  5. Compiler
    By Unregistered in forum C++ Programming
    Replies: 4
    Last Post: 04-28-2002, 04:00 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21