1. Check out our app, Forums for Android! Download and leave feedback here!

WinGW

Discussion in 'The Lounge' started by samuelmaskell, Sep 21, 2009.

  1. samuelmaskell

    samuelmaskell Well-Known Member
    Thread Starter
    56

    May 11, 2009
    293
    3
    56
    Software Engineering Student
    Victoria,BC
    Hello,
    This is a pretty specific problem so I doubt anyone will have any answer but.. I can hope. I'm posting this in a bunch of the forums I go on for that reason. Anyway, I just started a BEng program 2 weeks ago and I would like to be able to test the C programs that I write for computer science without having to go to the lab. Sounds easy but apparently isn't. In the lab we are using WinGW to compile our programs. I tried installing this and I thought everything went fine but when I try to compile something I just get
    Code (Text):
    1. 'gcc' is not recognized as an internal or external command, operable program or batch file.
    I followed the exact same steps that I used in the lab and I have tried it on both 64bit Windows 7 and 32bit Vista. However, in the lab we were using XP. I don't know if this could be the problem or not. I believe some of the other students have gotten it to work on Vista though. I don't know what I'm doing wrong. Do I have to somehow make it so that WinGW is running? I don't see anything about that. Perhaps I could try to use I different compiler but I would like to be able to use this so that everything is the same as in the lab.

    Thanks for your help,
    Samuel Maskell
     

    Advertisement

  2. KlaymenDK

    KlaymenDK Well-Known Member
    143

    May 29, 2009
    1,217
    130
    143
    Denmark
    This is a pretty daft counter-question, but you do have gcc installed, right? It's not a standard Windows component, so you should 'know' if you have it.

    The gcc web site mentions MinGW, and you mention WinGW; I don't know if they are the same, related, or one a component of the other.
     
  3. samuelmaskell

    samuelmaskell Well-Known Member
    Thread Starter
    56

    May 11, 2009
    293
    3
    56
    Software Engineering Student
    Victoria,BC
    yes, it is part of WinGW. However I searched WinGW's site for "gcc" and it came up with "how to intall the MinGW (GCC) compiler suite".
    it says,
    "Download MinGW automated installer from Browse MinGW - Minimalist GNU for Windows Files on SourceForge.net Run it and choose options as per needed. It would install everything right. Then add C:\MinGW\bin to you PATH variable."


    I had already done everything except the last sentence. What does "The add C:\MinGW\bin to your PATH variable" mean?
    If I go into that folder I see a "gcc.exe" but that doesn't help me. What is a PATH variable?
     
  4. justjimjpc

    justjimjpc Premium Member
    663

    Nov 3, 2008
    10,543
    210
    663
    Washington DC, USA

    - On Windows, right-click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path (under System Variables). Add the full path to the gcc.exe/ directory to the path.


    This will make the gcc.exe usuable on the computer no matter what directory you are in ...
     
  5. samuelmaskell

    samuelmaskell Well-Known Member
    Thread Starter
    56

    May 11, 2009
    293
    3
    56
    Software Engineering Student
    Victoria,BC
    wow.. that was an probably exactly the answer I was looking for. However, it STILL doesn't seem to be working.. I have no idea why. But thank you for your help anyway. I really appreciate your being so precise.

    Samuel Maskell
     
  6. justjimjpc

    justjimjpc Premium Member
    663

    Nov 3, 2008
    10,543
    210
    663
    Washington DC, USA

    NP, sorry you still have the other problem ...
     
  7. samuelmaskell

    samuelmaskell Well-Known Member
    Thread Starter
    56

    May 11, 2009
    293
    3
    56
    Software Engineering Student
    Victoria,BC
    I ended up just using devc++ which includes MinGW. It works fine. I still have no idea what my problem was.. anyway, since I got a compiler to work, I finished my assignment the day that it was assigned even though we have a week to do it =]

    once again, thanks for your help
     
  8. Jacqueline

    Jacqueline Well-Known Member
    36

    Sep 7, 2009
    393
    6
    36
    Florida
    To add a path, you need to make sure you put a semicolon to separate it. Also, you want to use the system path and not the user path. Typically, you just go to the end, type a semicolon, then give it the path. For instance, your path may be
    c:\windows\system32;c:\windows
    you would change it to
    c:\windows\system32;c:\windows;C:\MinGW\bin

    Double-check it to make sure you have the semicolon there or the last path you have on the line may not work.
     

Share This Page

Loading...