<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.codeblocks.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Simdol</id>
	<title>Code::Blocks - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.codeblocks.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Simdol"/>
	<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php/Special:Contributions/Simdol"/>
	<updated>2026-05-19T13:54:26Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_MinGW_with_Vista&amp;diff=5044</id>
		<title>Installing MinGW with Vista</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_MinGW_with_Vista&amp;diff=5044"/>
		<updated>2007-11-05T02:10:48Z</updated>

		<summary type="html">&lt;p&gt;Simdol: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Documentation]]&lt;br /&gt;
--[[User:Darthdespotism|Darthdespotism]] 07:23, 29 June 2007 (UTC)&lt;br /&gt;
== Before we start ==&lt;br /&gt;
&lt;br /&gt;
Before starting to install MinGW under Windows Vista there are some things to remember:&lt;br /&gt;
&lt;br /&gt;
* MinGW '''must''' be located on the same partition as the files you want to compile&lt;br /&gt;
* There may be issues if you don't install MinGW in the toplevel folder (e.g. C:\MinGW) but in some folder (e.g. C:\Compilers\MinGW).  There is a possible solution to this problem (see the &amp;quot;Troubleshooting&amp;quot; section at the bottom of this page).&lt;br /&gt;
&lt;br /&gt;
For this HOWTO I used some Conventions:&lt;br /&gt;
&lt;br /&gt;
* I assumed you are going to install in C:, if you want to install on another partition (which may be clever as the sources must be on the same partition) you'll have to modifie the path acordingly&lt;br /&gt;
* I used ''MinGW-Version'' to indicate that you must use your Version of MinGW here. As you can see on my pictures it is for me 4.2.0 and for those who downloaded on [http://mingw.org http://mingw.org] it is most probably 3.4.2&lt;br /&gt;
&lt;br /&gt;
Just one thing left: I've done this under Vista Business and a friend of mine reported it working with Home Premium. I hope it works on the other versions, too.&lt;br /&gt;
&lt;br /&gt;
== Getting MinGW ==&lt;br /&gt;
First of all you need the MinGW Compiler to be installed. I used the installer but all methods desciribed under [[MinGW installation]] should work fine. You may althoug want to upgrade your Version of MinGW to 4.* though. When you finished installing the basic MinGW we'll start making it work with Windows Vista. (Note: There is no need to set any %PATH% - variables when you use only Codeblocks, this is the way I'll focuse on)&lt;br /&gt;
&lt;br /&gt;
== Actual Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Executeables ===&lt;br /&gt;
If you haven't already done it it is time to install and start Code::Blocks. It's a good idea to creakte a sample &amp;quot;console application&amp;quot; so you have a basic &amp;quot;Hello world&amp;quot; to test your progress. As I first tried to run &amp;quot;Compile&amp;quot; without any Modifications I got the following Error:&lt;br /&gt;
&lt;br /&gt;
 -------------- Build: Debug in test ---------------&amp;lt;br /&amp;gt;&lt;br /&gt;
 Compiling: main.cpp&amp;lt;br /&amp;gt;&lt;br /&gt;
 mingw32-g++.exe: CreateProcess: No such file or directory&amp;lt;br /&amp;gt;&lt;br /&gt;
 Process terminated with status 1 (0 minutes, 0 seconds)&amp;lt;br /&amp;gt;&lt;br /&gt;
 0 errors, 0 warnings&lt;br /&gt;
&lt;br /&gt;
This doesn't tell us very much. The problem here actually is, that MinGW is unable to find its helper executeables, in this case cc1plus.exe. To fix this go to your &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Compiler and Debugger&amp;quot; -&amp;gt; &amp;quot;Toolchain executeables&amp;quot; -&amp;gt; &amp;quot;Additional paths&amp;quot; and add there the Directory &amp;quot;C:\MinGW\libexec\gcc\mingw32\''MinGW-Version'' where ''MinGW-Version'' is the Version of MinGW you are using. If you use a unmodified Version this is most probably 3.4.2, as I have the newer 4.2.0 I use this.&lt;br /&gt;
&lt;br /&gt;
[[Image:mingw_vista_01.png]][[Image:mingw_vista_02.png]]&lt;br /&gt;
&lt;br /&gt;
Let's try to compile again and see the progress.&lt;br /&gt;
&lt;br /&gt;
=== Compiler ===&lt;br /&gt;
&lt;br /&gt;
Hm still doesn't work, but the error changed:&lt;br /&gt;
&lt;br /&gt;
 -------------- Build: Debug in test ---------------&amp;lt;br /&amp;gt;&lt;br /&gt;
 Compiling: main.cpp&amp;lt;br /&amp;gt;&lt;br /&gt;
 C:\Users\Christoph\Projects\test\main.cpp:1:20: error: iostream: No such file or directory&amp;lt;br /&amp;gt;&lt;br /&gt;
 C:\Users\Christoph\Projects\test\main.cpp: In function 'int main()':&amp;lt;br /&amp;gt;&lt;br /&gt;
 C:\Users\Christoph\Projects\test\main.cpp:7: error: 'cout' was not declared in this scope&amp;lt;br /&amp;gt;&lt;br /&gt;
 C:\Users\Christoph\Projects\test\main.cpp:7: error: 'endl' was not declared in this scope&amp;lt;br /&amp;gt;&lt;br /&gt;
 Process terminated with status 1 (0 minutes, 1 seconds)&amp;lt;br /&amp;gt;&lt;br /&gt;
 3 errors, 0 warnings&lt;br /&gt;
&lt;br /&gt;
So MinGW is not able to find &amp;lt;iostream&amp;gt;. Let's tell him where to search:&lt;br /&gt;
&lt;br /&gt;
Still in the Compiler and Debugger dialogue go to &amp;quot;Search directories&amp;quot; -&amp;gt; &amp;quot;Compiler&amp;quot; and add:&lt;br /&gt;
&lt;br /&gt;
 C:\MinGW\include\c++\''MinGW-Version''&amp;lt;br /&amp;gt;&lt;br /&gt;
 C:\MinGW\include\c++\''MinGW-Version''\backward&amp;lt;br /&amp;gt;&lt;br /&gt;
 C:\MinGW\include\c++\''MinGW-Version''\mingw32&amp;lt;br /&amp;gt;&lt;br /&gt;
 C:\MinGW\lib\gcc\mingw32\''MinGW-Version''\include&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are not necessarily all of them needed, but these are the directories MinGW searches in normally.&lt;br /&gt;
&lt;br /&gt;
Try again to compile. The compiler should now execute nurmally, but there is a Linker error left:&lt;br /&gt;
&lt;br /&gt;
=== Linker ===&lt;br /&gt;
&lt;br /&gt;
 Linking console executable: bin\Debug\test.exe&amp;lt;br /&amp;gt;&lt;br /&gt;
 ld: cannot find -lgcc&amp;lt;br /&amp;gt;&lt;br /&gt;
 Process terminated with status 1 (0 minutes, 1 seconds)&amp;lt;br /&amp;gt;&lt;br /&gt;
 1 errors, 0 warnings&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So we apparently need to tell MinGW where to search for it's librarys. This is again done by adding some &amp;quot;Search directories&amp;quot;, but now we use the section &amp;quot;Linker&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: C:\MinGW\lib\gcc\mingw32\''MinGW-Version''&lt;br /&gt;
&lt;br /&gt;
Try to compile, it should work.&lt;br /&gt;
&lt;br /&gt;
[[Image:mingw_vista_03.png]][[Image:mingw_vista_04.png]]&lt;br /&gt;
&lt;br /&gt;
=== Trouble shooting ===&lt;br /&gt;
&lt;br /&gt;
If this does not work out for you there is some advice to figure it out on your own:&lt;br /&gt;
&lt;br /&gt;
* If there is a file not found by MinGW use your search function to look for it, and add it where it belongs&lt;br /&gt;
** If it's an executeable (.exe) add it to the &amp;quot;additional paths&amp;quot; under &amp;quot;toolchain executeables&amp;quot;&lt;br /&gt;
** If it's a header (.h, .hpp or without extension) add it to &amp;quot;compiler&amp;quot; under &amp;quot;search directories&amp;quot;&lt;br /&gt;
** If it's a library (.o, .a) add it to &amp;quot;linker&amp;quot; under &amp;quot;search directories&amp;quot;&lt;br /&gt;
* Compile with the -v flag. You can do this by simply adding -v to &amp;quot;Build options&amp;quot; -&amp;gt; &amp;quot;Compiler&amp;quot; -&amp;gt; &amp;quot;Other options&amp;quot;&lt;br /&gt;
* Try entering the complete path to each program (for example, changing &amp;quot;mingw32-g++.exe&amp;quot; to &amp;quot;D:\toolkits\MinGW513\bin\mingw32-g++.exe&amp;quot;).  This may allow projects to be compiled, regardless of which partition and folder MinGW is installed to.  See [/index.php/topic,6422.0.html this forum thread] for more details.&lt;br /&gt;
--------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== '''An Easy Fix''' ==&lt;br /&gt;
&lt;br /&gt;
I have been using this fix that was made available in the Mingw-Users list, by a kind a person. It works fine without having to do any abnormal modifications to your CodeBlocks setups.&lt;br /&gt;
&lt;br /&gt;
----------------------------------&lt;br /&gt;
If it helps anyone else, I took the three patched drivers that Danny&lt;br /&gt;
posted (gcc, g++, collect2) and copied them to their various aliases&lt;br /&gt;
(e.g. c++, mingw-g++, etc) and put them in the appropriate directory&lt;br /&gt;
structure, and made it a tarball:&lt;br /&gt;
&lt;br /&gt;
http://dessent.net/tmp/gcc-vista-3.4.5-20060117-1.tar.gz&lt;br /&gt;
&lt;br /&gt;
$ tar ztvf gcc-vista-3.4.5-20060117-1.tar.gz&lt;br /&gt;
-rwxr-xr-x brian/None 86016 2007-05-18 18:41 bin/c++.exe&lt;br /&gt;
-rwxr-xr-x brian/None 86016 2007-05-18 18:41 bin/g++.exe&lt;br /&gt;
-rwxr-xr-x brian/None 83456 2007-05-18 18:40 bin/gcc.exe&lt;br /&gt;
-rwxr-xr-x brian/None 86016 2007-05-18 18:41 bin/mingw32-c++.exe&lt;br /&gt;
-rwxr-xr-x brian/None 86016 2007-05-18 18:41 bin/mingw32-g++.exe&lt;br /&gt;
-rwxr-xr-x brian/None 83456 2007-05-18 18:40 bin/mingw32-gcc-3.4.5&lt;br /&gt;
-rwxr-xr-x brian/None 83456 2007-05-18 18:40 bin/mingw32-gcc.exe&lt;br /&gt;
-rwx------ brian/None 85504 2007-05-18 18:41&lt;br /&gt;
libexec/gcc/mingw32/3.4.5/collect2.exe&lt;br /&gt;
&lt;br /&gt;
If you unpack this in your MinGW root folder (e.g. /mingw) just like all&lt;br /&gt;
the other gcc-foo tarballs it should install the files in all the right&lt;br /&gt;
places. I tested this on a Vista copy running VMware and it worked fine&lt;br /&gt;
for compiling and linking C and C++.&lt;br /&gt;
&lt;br /&gt;
(That's for 3.4.5 only.)&lt;/div&gt;</summary>
		<author><name>Simdol</name></author>
	</entry>
</feed>