<?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=Cesar</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=Cesar"/>
	<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php/Special:Contributions/Cesar"/>
	<updated>2026-04-06T12:36:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=3862</id>
		<title>Installing Code::Blocks from source on Windows</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=3862"/>
		<updated>2006-09-29T19:04:37Z</updated>

		<summary type="html">&lt;p&gt;Cesar: added $(#cb) variable; renamed C::B, codeblocks, etc. to Code::Blocks to meet naming conventions; improoved readability&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installing Code::Blocks]]&lt;br /&gt;
[[Category:Installing Code::Blocks from source]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
'''Note for RC2 users'''&lt;br /&gt;
&lt;br /&gt;
The older Code::Blocks RC2 does not support global compiler variables which were added after RC2 was released and is unable to read project files generated with post-RC2 versions.&lt;br /&gt;
To build Code::Blocks, you need a post-RC2 build, such as  any of the ''nightly builds'' obtainable by [/index.php?board=20.0 searching the forum].&lt;br /&gt;
&lt;br /&gt;
=== MinGW compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with the MinGW compiler. You will need a complete, working [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
Code::Blocks officially supports wxWidgets 2.6.2&lt;br /&gt;
&lt;br /&gt;
You do ''not'' need MSYS  (''in fact, if you have MSYS, make sure it is not in your PATH when building wxWidgets'').&lt;br /&gt;
&lt;br /&gt;
[http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.6.2.zip Download wxWidgets 2.6.2 from Sourceforge].&lt;br /&gt;
&lt;br /&gt;
You can also use the more recent '''[http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.6.3-Setup.exe wxWidgets-2.6.3]''', but you will need to install '''[ftp://biolpc22.york.ac.uk/pub/2.6.3/wxWidgets-2.6.3-Patch-2.zip patch 2 for 2.6.3]''' over it.&lt;br /&gt;
The patch is not a diff file, but a '''.zip''' file that must be unpacked on top of wxWidgets tree.&lt;br /&gt;
&lt;br /&gt;
=== SVN client ===&lt;br /&gt;
&lt;br /&gt;
In order to check out the Code::Blocks sources you will need a SVN client.&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.tigris.org/download.html TortoiseSVN] on your machine, as this is a lot more comfortable. However, if you get a bad feeling when some program is messing with your Explorer menu, then you can use the [http://subversion.tigris.org/project_packages.html svn commandline client].&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks sources ===&lt;br /&gt;
&lt;br /&gt;
You will also (obviously) need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
Using ''TortoiseSVN'', make a folder where you want to store the sources, right-click on the folder, and select &amp;quot;SVN Checkout...&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the top box, enter svn://svn.berlios.de/codeblocks/trunk and hit the OK button.&lt;br /&gt;
&lt;br /&gt;
Using ''svn'', you have to open a command prompt (&amp;quot;DOS Window&amp;quot;). Make a folder, change directory, and run svn:&lt;br /&gt;
&lt;br /&gt;
  mkdir codeblocks-head&lt;br /&gt;
  cd codeblocks-head&lt;br /&gt;
  svn checkout svn://svn.berlios.de/codeblocks/trunk&lt;br /&gt;
&lt;br /&gt;
=== zip.exe ===&lt;br /&gt;
&lt;br /&gt;
You'll also need the 'zip.exe' compression program, found [http://www.info-zip.org/ here].&lt;br /&gt;
Only the command-line zip.exe is needed; you must install it somewhere in your PATH.&lt;br /&gt;
Put zip.exe wherever you installed MinGW in the '''bin''', or the '''mingw32\bin''' folder. &lt;br /&gt;
&lt;br /&gt;
== Building ==&lt;br /&gt;
&lt;br /&gt;
=== Unicode Build ===&lt;br /&gt;
&lt;br /&gt;
==== Compile wxWidgets in Unicode mode ====&lt;br /&gt;
&lt;br /&gt;
After unpacking the zip file to a directory of your choice, open a cmd prompt, and navigate to the folder build/msw inside the wxWidgets folder. Use the following commands to compile wxWidgets:&lt;br /&gt;
&lt;br /&gt;
  set path=c:\mingw\bin;c:\mingw\mingw32\bin&lt;br /&gt;
  mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
  mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
This assumes your MinGW installation is in C:\mingw. Use a different path if you installed MinGW somewhere else.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of warning messages during compilation. Don't worry, this is normal, you are compiling wxWidgets. The build process may take 10-30 minutes, depending on your computer's speed.&lt;br /&gt;
&lt;br /&gt;
'''Optional:'''&lt;br /&gt;
&lt;br /&gt;
To reduce the size of your wxWidgets library, you can disable features which are not used by Code::Blocks. However, you should not do this unless you know what you are doing. You have to delete the generated setup.h from lib/gcc_dll/msw/wx before building, because your changes to include/wx/msw will otherwise not be honoured.&lt;br /&gt;
&lt;br /&gt;
==== Compile Code::Blocks ====&lt;br /&gt;
&lt;br /&gt;
Open the project CodeBlocks.cbp. You will be prompted to define two global variables:&lt;br /&gt;
; $(#wx): path to wxWidgets sources&lt;br /&gt;
; $(#cb): path Code::Blocks sources&lt;br /&gt;
Hit the blue gear and lean back. Compilation may take 3-5 minutes, depending on the speed of your computer.&lt;br /&gt;
&lt;br /&gt;
After the compilaton has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw26u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;src\devel&amp;lt;/tt&amp;gt; directory inside the Code::Blocks source folder (it will also work if you keep a copy of that library in your Windows folder or anywhere in your system path, but this is generally not recommended because you can get into dll hell).&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;tt&amp;gt;src\update.bat&amp;lt;/tt&amp;gt; (located in the root source directory). This will pack the resource files and copy libraries and plugins to their correct locations.&lt;br /&gt;
The location of executable is &amp;lt;tt&amp;gt;src\output&amp;lt;/tt&amp;gt; in Code::Blocks tree. From here you'll not need anymore the nighty build.&lt;br /&gt;
&lt;br /&gt;
One little note for svn updates and rebuilds: just go into the Code::Blocks root directory and do '''svn update''' (or use Turtoise svn).&lt;br /&gt;
&lt;br /&gt;
Then run the &amp;lt;tt&amp;gt;src\output\codeblocks.exe&amp;lt;/tt&amp;gt;, reload project, build it, reload plugins workspace, build it, quit Code::Blocks and re-run &amp;lt;tt&amp;gt;src\update.bat&amp;lt;/tt&amp;gt;. You'll have an up-to-date Code::Blocks in 3 minutes!&lt;br /&gt;
&lt;br /&gt;
==== Install Code::Blocks ====&lt;br /&gt;
&lt;br /&gt;
Copy the folder output to where you want Code::Blocks to reside.&lt;br /&gt;
&lt;br /&gt;
==== Compile contributed (or your own) plugins ====&lt;br /&gt;
&lt;br /&gt;
The workspace file ContribPlugins.workspace contains the project files for all contributed plugins. Open that workspace and compile the plugins which you would like to use (or select &amp;quot;Build Workspace&amp;quot; from the context menu if you want them all). Don't forget to run update.bat again after building the contrib plugins.&lt;br /&gt;
&lt;br /&gt;
=== ANSI Build ===&lt;br /&gt;
&lt;br /&gt;
''Note:&lt;br /&gt;
Code::Blocks is now built in Unicode mode by default (see above).&lt;br /&gt;
However, if you don't care about Unicode or if you use an old Windows version that does not support Unicode, then you might want to build an ANSI version nevertheless.''&lt;br /&gt;
&lt;br /&gt;
==== Compile wxWidgets in ANSI mode ====&lt;br /&gt;
&lt;br /&gt;
After unpacking the zip file to a directory of your choice, open a cmd prompt, and navigate to the folder build/msw inside the wxWidgets folder. Use the following commands to compile wxWidgets&lt;br /&gt;
&lt;br /&gt;
  set path=c:\mingw\bin;c:\mingw\mingw32\bin&lt;br /&gt;
  mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0 clean&lt;br /&gt;
  mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0&lt;br /&gt;
&lt;br /&gt;
This assumes your MinGW installation is in C:\mingw. Use a different path if you installed MinGW somewhere else.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of warning messages during compilation. Don't worry, this is normal, you are compiling wxWidgets. The build process may take 10-30 minutes, depending on your computer's speed.&lt;br /&gt;
&lt;br /&gt;
'''Optional:'''&lt;br /&gt;
&lt;br /&gt;
To reduce the size of your wxWidgets library, you can disable features which are not used by Code::Blocks. However, you should not do this unless you know what you are doing. You have to delete the generated setup.h from lib/gcc_dll/msw/wx before building, because your changes to include/wx/msw will otherwise not be honoured.&lt;br /&gt;
&lt;br /&gt;
==== Compile Code::Blocks ====&lt;br /&gt;
&lt;br /&gt;
Open the project CodeBlocks.cbp. You will be prompted to define the global variable $(#wx) if you have not used it before. Enter the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
'''Important:'''  The project file is set to compile an Unicode version of Code::Blocks by default. To make an ANSI build, you have to make the following two changes to build options before compiling:&lt;br /&gt;
1. In the &amp;quot;Compiler&amp;quot; tab, under &amp;quot;#defines&amp;quot;, remove the entry wxUSE_UNICODE.&lt;br /&gt;
2. Under &amp;quot;Custom variables&amp;quot;, set the variable WX_SUFFIX to empty (default value: u).&lt;br /&gt;
&lt;br /&gt;
Hit the blue gear and lean back. Compilation may take 3-5 minutes, depending on the speed of your computer.&lt;br /&gt;
&lt;br /&gt;
After the compilaton has finished, copy wxmsw26u_gcc_custom.dll from lib\gcc_dll inside the wxWidgets directory to the devel directory inside the Code::Blocks source folder (it will also work if you keep a copy of that library in your Windows folder or anywhere in your system path, but this is generally not recommended because you can get into [http://en.wikipedia.org/wiki/DLL_hell dll hell] ).&lt;br /&gt;
Run update.bat (located in the root source directory). This will pack the resource files and copy libraries and plugins to their correct locations.&lt;br /&gt;
The location of executable is src\output in C::B tree. From here you'll not need the nighty build anymore.&lt;br /&gt;
&lt;br /&gt;
One little note for svn updates and rebuilds : just go into the codeblocks root directory and do '''svn update''' (or use Turtoise svn).&lt;br /&gt;
&lt;br /&gt;
Then run the src/output/codeblocks.exe, reload project, build it, reload plugins workspace, build it, quit codeblocks and re-run update.bat. You'll have an up-to-date C::B in 3 minutes !&lt;br /&gt;
&lt;br /&gt;
==== Install Code::Blocks ====&lt;br /&gt;
&lt;br /&gt;
Copy the folder output to where you want Code::Blocks to reside.&lt;br /&gt;
&lt;br /&gt;
==== Compile contributed (or your own) plugins ====&lt;br /&gt;
&lt;br /&gt;
The workspace file ContribPlugins.workspace contains the project files for all contributed plugins. Open that workspace and compile the plugins which you would like to use (or select &amp;quot;Build Workspace&amp;quot; from the context menu if you want them all). Don't forget to run update.bat again after building the contrib plugins.&lt;br /&gt;
&lt;br /&gt;
Provided by Thomas Denk&lt;br /&gt;
Small edits by Max&lt;/div&gt;</summary>
		<author><name>Cesar</name></author>
	</entry>
</feed>