Thread: Compiler

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    12

    Compiler

    Hey guys.

    First off i'd just like to say im really new to C. We are just about to start it soon in uni and our lecturer recommended a book for us. I decided to get it and do some reading up before we start. The book i got was "C Programming in easy steps" by Mike Mcgrath.

    I started reading and it said i need to install a compiler on my system. It reccomended MinGW. I downloaded this and ticked the "g++" and "MinGW base tools" like it said. It then told me to add this too my system path. So i went to Control Panel > System > Advanced > Environment Variables. I found the "Path" and added ";c\minGW\bin; like it said. It then said if i go to cmd and type gcc - v I should get information about it, but i dont. It says "gcc is not a recognized as an internal or internal command, operable probram of batch file.

    Im not sure what im doing wrong and i thought you guys would be able to help, thanks.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    After you added the environment variable, did you restart the cmd application?
    bit∙hub [bit-huhb] n. A source and destination for information.

  3. #3
    Registered User
    Join Date
    Oct 2009
    Posts
    12
    Quote Originally Posted by bithub View Post
    After you added the environment variable, did you restart the cmd application?
    As in close it down and open it up again, yeah. Would restarting my PC help?

  4. #4
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Martyn27 View Post
    I found the "Path" and added ";c\minGW\bin; like it said.
    Are you sure it didn't say ";c:\minGW\bin" instead?

    Also, does the directory c:\minGW\bin actually exist? And is the gcc.exe located in that directory?
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  5. #5
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Quote Originally Posted by Martyn27
    It then said if i go to cmd and type gcc - v I should get information about it, but i dont.
    I don't use Windows very much anymore, but don't you need to use the command "gcc.exe" instead of just "gcc"?
    bit∙hub [bit-huhb] n. A source and destination for information.

  6. #6
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by bithub View Post
    I don't use Windows very much anymore, but don't you need to use the command "gcc.exe" instead of just "gcc"?
    No, that would suck
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  7. #7
    Registered User
    Join Date
    Oct 2009
    Posts
    12
    Quote Originally Posted by brewbuck View Post
    Are you sure it didn't say ";c:\minGW\bin" instead?

    Also, does the directory c:\minGW\bin actually exist? And is the gcc.exe located in that directory?
    Nope is definately just ;c\

    Yup the directory exists

    Yup there is a gcc.exe in there

    Quote Originally Posted by bithub View Post
    I don't use Windows very much anymore, but don't you need to use the command "gcc.exe" instead of just "gcc"?

    Tried Gcc.exe - v same result.

    Should i try changing ;c\ to ;c:\?

    Edit: Tried it it works. Great the book lies to me :< Thanks for your help Brew and Bit
    Last edited by Martyn27; 10-09-2009 at 03:31 PM.

  8. #8
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    If you're going to use MinGW from the command line, I would be using MSYS.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiler Paths...
    By Cobra in forum C++ Programming
    Replies: 5
    Last Post: 09-26-2006, 04:04 AM
  2. C Compiler and stuff
    By pal1ndr0me in forum C Programming
    Replies: 10
    Last Post: 07-21-2006, 11:07 AM
  3. I can't get this new compiler to work.
    By Loduwijk in forum C++ Programming
    Replies: 7
    Last Post: 03-29-2006, 06:42 AM
  4. how to call a compiler?
    By castlelight in forum C Programming
    Replies: 3
    Last Post: 11-22-2005, 11:28 AM
  5. Bad code or bad compiler?
    By musayume in forum C Programming
    Replies: 3
    Last Post: 10-22-2001, 09:08 PM