1. Post #1
    Gold Member
    Dennab
    August 2011
    326 Posts
    Hey guys can you help me with this problem. I dont know how to compile C on Cmd. It gives error with both gcc and g++. i think i need to use another compiler because gcc mostly using on cpp.

    PS. I know that,it is so dumb question, but pls dont "dumb" me.
    Reply With Quote Edit / Delete Reply Windows 7 Azerbaijan Show Events Funny Funny x 3Dumb Dumb x 3Friendly Friendly x 1 (list)

  2. Post #2
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    It would be a good idea to start by telling what you've tried and what error you get. Also, do you have any specific reason to use GCC on Windows?
    Reply With Quote Edit / Delete Reply Windows 7 Netherlands Show Events Friendly Friendly x 1 (list)

  3. Post #3
    Gold Member

    March 2005
    3,028 Posts
    My guess is that the GCC binaries directory isn't listed in %PATH%

    Also, do you have any specific reason to use GCC on Windows?
    More like "any specific reason to use the command-line on Windows".

    Install Code::Blocks or something if you don't.
    Reply With Quote Edit / Delete Reply Windows 7 Show Events Agree Agree x 2 (list)

  4. Post #4
    Gold Member
    Dennab
    August 2011
    326 Posts


    this is the error. im a super beginner on "c", so i just googled how to compile c, and i got alotof results with related gcc

    Edited:

    code::block is installed.
    Reply With Quote Edit / Delete Reply Windows 7 Azerbaijan Show Events Funny Funny x 2Dumb Dumb x 1Friendly Friendly x 1 (list)

  5. Post #5
    Team Hamster
    jalb's Avatar
    December 2009
    567 Posts
    Open your start menu, right click "Computer" and hit "Properties." On the left side look for "Advanced system settings" and click that. There will be a button on this popup that says "Environment Variables," click it. Add a "New..." environment variable. Put the name as "PATH" and the variable value wherever you installed GCC. Once you do that it will recognize those commands.

    Alternatively, download an IDE such as Code::Blocks or Visual Studio. If there's no specific reason for using command line GCC, then don't. Unless you like doing things the hard way.

    Edit: Just saw your edit. Let us know how it goes.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Informative Informative x 2Agree Agree x 1Friendly Friendly x 1 (list)

  6. Post #6
    awfa3's Avatar
    April 2007
    185 Posts
    You need to add gcc/g++ to your %path% environmental variable. Also, can I ask why you are learning C instead of C++?

    Ninja'd
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Informative Informative x 1 (list)

  7. Post #7
    Gold Member

    March 2005
    3,028 Posts
    Also, can I ask why you are learning C instead of C++?
    Why shouldn't he, exactly?
    Reply With Quote Edit / Delete Reply Windows 7 Show Events Agree Agree x 6 (list)

  8. Post #8
    Gold Member
    Dennab
    August 2011
    326 Posts
    Open your start menu, right click "Computer" and hit "Properties." On the left side look for "Advanced system settings" and click that. There will be a button on this popup that says "Environment Variables," click it. Add a "New..." environment variable. Put the name as "PATH" and the variable value wherever you installed GCC. Once you do that it will recognize those commands.

    Alternatively, download an IDE such as Code::Blocks or Visual Studio. If there's no specific reason for using command line GCC, then don't. Unless you like doing things the hard way.

    Edit: Just saw your edit. Let us know how it goes.



    Thanks for help guys)) After adding "PATH" cmd started gcc
    Reply With Quote Edit / Delete Reply Windows 7 Azerbaijan Show Events Friendly Friendly x 9Programming King Programming King x 1Winner Winner x 1 (list)

  9. Post #9
    chimitos's Avatar
    September 2010
    2,352 Posts
    This thread, but more specifically ^you^, made me happy.
    You're so chill.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 4 (list)