Installing Microsoft 'MinGW' to the Windows 7 Environment!

Hi,

I have recently purchased the following book from Amazon ‘C++ Programming in Easy Steps’ which I hope to provide me with an introduction to C++ programming.

I have only recently purchased Windows 7, therefore I am very unfamiliar with the environment which is possibly a factor in the issue that I have. I have no prior knowledge of programming therefore I have begun following the books step-by-step installation instructions for ‘MinGW’, however I think the book pre-dates Windows 7 which makes the instructions a little hazy.

The instructions are as follows...

-------------------------------------------------------------------------------
1. Download ‘MinGW’ from http://sourceforge.net/projects/mingw
2. Install to the suggested location C:\minGW
3. When installation completes, click the System icon in Control Panel then the Advanced System Settings item - to launch the System Properties dialog.
4. In the System Properties dialog, push the Environment Variables button, select the Path System Variable, then push the Edit button and add the location C:\MinGW\bin to the path statement.
5. Click OK to close each dialog, then open a Command Prompt window and enter the command c++. If the installation is successful the compiler should respond that you have not specified and input files for compilation.
-------------------------------------------------------------------------------

Now, I have installed ‘MinGW’ however upon visiting the Control Panel in order to change the settings, I noticed that it’s completely different from XP/Vista.

Can someone please advise me on where I can locate the ‘System Icon’ as stated above in order to change the relevant path settings?

Any advice on this issue is greatly appreciated as I’m eager to have a go at the programming aspect of the book.

Thanks

Phibir

1. Microsoft didn't make MinGW; why the hell would Microsoft port their competitor's products to their operating system???
2. It should be quite easy to figure out the new control panel; the point of it is to make things easier.
3. This doesn't go here. It goes in the "Windows programming" section.

Why do you need to install it anyway? You can just download the files, extract them to a folder and add it to your %PATH%. It's not that much more difficult than using an auto-installer.

I haven't used windows 7 for a while, so I can't remember what the control panel looks like... but I'm sure you can figure it out.
Thanks for your reply.

1. As I said in my previous post, I have no programming experience. Therefore I think you and the fellow members of this forum should allow me a little ignorance in this subject. Until this morning I had never even heard of ‘MinGW’ let alone know who made it.

2. Fair enough comment on the control panel, however if I could figure it out by myself then I wouldn’t have joined these forums to ask for help would I?

3. Apologies for not posting this in the correct section of the forums, I will strive to ensure that I post in the correct place in future.

4. As stated in my original post “I have no prior knowledge of programming”; so I bought the ‘C++ Programming in Easy Steps’ book to teach me. The book states that I should download ‘MinGW’ and install as instructed above, so if it doesn’t tell me about manual installation then I’m not going to know how to do it am I!

5. As above, I don’t know where to locate the ‘system icon’ in control panel so I’ve come here to ask for help finding it. It’s not much help to me by you replying to my original post to say that you don’t know, now is it!

Maybe someone who does know could answer my original question please?

Thanks

Phibir
Okay,

I have managed to locate a step-by-step guide to installing ‘MinGW’ on XP/Vista. I’m still having problems getting ‘MinGW’ to work, which I assume is due to the fact that I’m using Windows 7. This forum thread explains how to get to the ‘Environmental Variables’ button that is described in the ‘C++ Programming in Easy Steps’ book that I'm using.

http://ziggybcn.proboards.com/index.cgi?board=publisher&action=display&thread=134&page=1

I have completed all the steps for the Vista setup however I still get no response from the command prompt when I enter ‘c++’ . I simply receive the following message...

‘c++’ is not recognized as an internal or external command, operable program or batch file.

If anyone knows a similar tutorial for Windows 7 then I would much appreciate you pointing me in the relevant direction if possible please?

Thanks

Phibir
1. I'm not trying to sound harsh here.
2. No, but it's not exactly a programming question.
3. Ok.
4. I thought that was common knowledge, that you can install programs without auto-installers.
5. Calm down, I'm trying to help but at the same time, you've come to a programming forum to ask about how to find a feature in an operating system...

Anyway, the program is usually called g++, with a g. I'm not berating you there, either; that's not something I'd expect you to know. But it's spelt with a g, for GNU.
Note that changes made to environment variables don't apply to already running instances of cmd.exe. Only to new instances.
Unless you make the change in that instance, e.g.
set PATH=%PATH%;foo
in which case it's the opposite, IIRC.
In that case, the change is volatile, limited to that instance.
Yeah, that's what I said :l

Edit: wait, I see what you mean. The way I said it would have meant that all already-running instances would have inherited that PATH.
Last edited on
I’m even more confused now than before, sorry guys.

Thanks ‘chrisname’ for your response, I’m sorry if I seem to be ranting; it’s just a little frustrating when things don’t work as expected.

I don’t understand what ‘Environment Variables’ are, the book I’m reading doesn’t seem to think I need to know at this stage of the process. I don’t understand what ‘PATH=%PATCH%;foo’ means or even in what context it’s needed in relation to beginning with writing programs (once again I can only apologise for my ignorance). What I need is a very simple idiot’s step-by-step guide to installing ‘MinGW’ on Windows 7 like the guide for XP/Vista that I posted above. Once it’s installed I can proceed with learning all the technical terms etc that comes with it.

Thanks

Phibir
ok do this....

open up control panel. this is a new(Win7) control panel with silly links instead of the standard one. click over on the left where it says something like "view old style control panel" if this doesn't exist there is a view all control panel items Control Panel\All Control Panel Items

also there is a god mode in Win7 which allows you to see all system tools when you create a folder you can make it god mode... ignore that and everything else I have said up until this point for now and follow as instructed below:


ok so we have a standard Win7 control panel open what we see is:

System & Security

Review computer status
Back-up your computer
Find and fix problems


then you also have other links such as User accounts, Apperance and personilize etc etc.

What we need is the System and Security, click on that link, (not the sublinks below)

This opens up a pile more Links:


Action Center : sublinks

Windows Firewall: with sublinks

System: & sublinks

Windows update with sublinks

Power Options: sublinks

Backup & Restore: sublinks

Windows Anytime Upgrade: ...

Admin tools ...

... etc


what we need to click here is the System, most of the sublinks go to the same page so it's not to important if you click those either.

now on the left you have a number of links:


Device Manager
Remote Settings
System protection
Advanced system settings


Click "Advanced System settings"


This opens up the typical "old style system window", It's damn complicated for someone not familiar with Windows and the old windows systems, 3.5 95, 98, 2000, xp, vista etc.
So don't feel too bad, it's just poor design IMO.

Ok now we have this window open you need to click on Advanced tab

now down the bottom is the "Environment Variables" Button, click this:

now the top text box contains "User Variables" for whatever your username is, this you can use to your advantage later on so keep it in mind.

But we however will be editing the second textbox, the one on the bottom titled System Variables

There will be a number of entries in this, eg.
Com_spec %SystemRoot%\system32\cmd.exe
FP_NO_HOST_C...
NUMBER_OF_PAT...
etc

scroll down until you see the one titled " Path "

click on this and then click the "edit" button

Now another small window will open up it has:
Variable Name: Path
Variable Value: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;

or something to that effect, When the window firsts opens up the text WILL BE HIGHLIGHTED, which is very important, as you must NOT press a key which would destroy the information already contained in the path. for example typing "h" would remove all the previous values and replace with "h" ... This is yet again another "poor design". Just push the right arrow key, or click with you mouse somewhere in the "value" line, so all the text is not highlighted anymore.
Note: if you do destroy this info just click the cancel button, and click edit button again and the values will be reset.

ok now move to the end of the path... now what seperates each value is the semi-colon, so you need to place a semi-colon ( ; ) at the end if there is not one already there. Now copy / paste the directory which you want to add to the path at the end. for instance, If I want to add the path to my java compiler I would add this at the end:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_17\bin;

then again if I want to add some C++ stuff like QT, and Cygwin
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_17\bin;C:\Qt\2009.05\bin;C:\Cygwin\bin;

rather than typing in the path, just open up explorer window and change directory to the directory of the mingw compilers, not just the mingw directory, But the sub folder where the executable is, or where all the exe's are, there should be some others such as gdb and stuff.
just click on the folder directory and hit copy ( ctrl+c ) and then paste in the path variable ( ctrl+v )

click "ok", "ok" when you are done, and that's it !

regards G.
Last edited on
For the love of God, just get an IDE

http://cplusplus.com/forum/articles/7263/

I recommend VS:

http://www.microsoft.com/express/vc/


Download, run, click the "Install" button.

Disregard the masochists in this thread XD
Thank you for the detailed step-by-step guide ‘gcampton’ it’s exactly what I needed.

I followed your instructions and noticed that the cause of the problem was due to the fact that I have left a space after the semi colon in the ‘Environmental Variables’ Path section. If your detailed section on adding ‘c:\cywin\bin’ to the end hadn’t have highlighted the fact that I had left a space, I would have probably never got it working.

I have now managed to progress to creating the basic ‘hello world’ program in command prompt. I guess I’m a damn long way from doing anything constructive with the language but we all have to start somewhere!

I’d also like to take this opportunity to thank everyone who replied to my posts , I couldn’t have done it without you, so THANKS.

Cheers

Phibir
Topic archived. No new replies allowed.