• How to compile C on cmd
    8 replies, posted
  • 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.
  • 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?
  • My guess is that the GCC binaries directory isn't listed in %PATH% [QUOTE=Overv;32007596]Also, do you have any specific reason to use GCC on Windows?[/QUOTE] More like "any specific reason to use the [i]command-line[/i] on Windows". Install Code::Blocks or something if you don't.
  • [IMG]http://a3.sphotos.ak.fbcdn.net/hphotos-ak-snc7/302792_106530526119820_100002886187682_33534_1395466_n.jpg[/IMG] 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 [editline]30th August 2011[/editline] code::block is installed.
  • 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.
  • 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
  • [QUOTE=awfa3;32008231]Also, can I ask why you are learning C instead of C++?[/QUOTE] Why shouldn't he, exactly?
  • [QUOTE=jalb;32008214]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.[/QUOTE] [IMG]http://a3.sphotos.ak.fbcdn.net/hphotos-ak-ash4/306892_106566806116192_100002886187682_33777_4119804_n.jpg[/IMG] Thanks for help guys)) After adding "PATH" cmd started gcc