#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Installing MinGW


    Hey, I am trying to learn C programming and I have the C Programming Easy Steps book to try and help me. But I have tried downloading the MinGW and I can see the files in C:MinGW. I added ;C\MinGW\bin; to the end of the Path variable yet when I test gcc -v in Command Prompt, it says it's not recognized. Please could you tell me where I'm going wrong. Thanks.
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,163
    Rep Power
    2222
    That always works for me. I've even written a batch file that I can run from a new console to set that up (mine was installed with Dev-C++, so the path is different from yours):
    Code:
    path=c:\dev-cpp\bin;%PATH%
    Now, I have to do that every time I open a new console (AKA "Cmd Prompt"), because every new shell and sub-shell has its own environment which is a copy of its parent's environment. So my question to you is whether you had added that directory to the path in one "Command Prompt", which you subsequently closed, and then tried to run gcc in another one. If that is what you did, then your change to PATH did not affect the parent's environment and it ceased to exist as soon as you closed that console.

    You should either create a batch file like mine that you can run each time, or find change the system environment's PATH variable. If you do the latter, then you will need to discover where your particular version of Windows has chosen to hide that dialog from you. Good luck with that and happy hunting!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0
    thanks for all that :) to be honest, a lot of that was quite confusing to me so I really only understood parts of it but I think I've got the gist.
    Well with the code you put, I noticed it was different to what it said in my book.. It said put - ;C\MinGW\bin; but then I tried - C:\MinGW\bin;%PATH%
    So when I tried the command prompt again, it came up saying "Using built in specs. Thread model: Win32. gcc version 4.7.2 (GCC)" which a bit more in between, but the bit I just mentioned was what it said in the book that was supposed to happen.
    I'm probably wrong, but I think that's what's meant to happen.
    Thank you :)
    By the way, you've probably realised that I don't know anything about this stuff :')
  6. #4
  7. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,110
    Rep Power
    1803
    Perhaps do yourself a favour an download and install MinGW already integrated with an IDE such as:

    Code::Blocks + MinGW

    Orwell Dev-C++ (avoid the long unsupported Bloodshed Dev-C++)

IMN logo majestic logo threadwatch logo seochat tools logo