<?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=Headkase</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=Headkase"/>
	<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php/Special:Contributions/Headkase"/>
	<updated>2026-05-17T03:58:52Z</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=9360</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=9360"/>
		<updated>2017-08-22T23:20:00Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Build Code::Blocks */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
It is recommended, but not required, that you install a SVN client.  An example would be [http://tortoisesvn.net/downloads TortoiseSVN] if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools, which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
If you don't wish to use a SVN utility, you can download a snapshot from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Build Options ===&lt;br /&gt;
&lt;br /&gt;
Unpack the wxWidgets zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory there is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9359</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=9359"/>
		<updated>2017-08-22T23:17:08Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Code::Blocks Sources */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
It is recommended, but not required, that you install a SVN client.  An example would be [http://tortoisesvn.net/downloads TortoiseSVN] if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools, which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
If you don't wish to use a SVN utility, you can download a snapshot from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Build Options ===&lt;br /&gt;
&lt;br /&gt;
Unpack the wxWidgets zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory there is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9358</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=9358"/>
		<updated>2017-08-22T23:16:36Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Code::Blocks Sources */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
It is recommended, but not required, that you install a SVN client.  An example would be [http://tortoisesvn.net/downloads TortoiseSVN] if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools, which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
If you don't wish to use a SVN utility, you can download a snapshot from: http://sourceforge.net/p/codeblocks/code/trunk ➡ &amp;quot;Download Snapshot.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Build Options ===&lt;br /&gt;
&lt;br /&gt;
Unpack the wxWidgets zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory there is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9357</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=9357"/>
		<updated>2017-08-22T23:14:09Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* SVN */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
It is recommended, but not required, that you install a SVN client.  An example would be [http://tortoisesvn.net/downloads TortoiseSVN] if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools, which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
If you don't wish to use a SVN utility, you can download a snapshot from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Build Options ===&lt;br /&gt;
&lt;br /&gt;
Unpack the wxWidgets zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory there is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9356</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=9356"/>
		<updated>2017-08-22T23:12:15Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* SVN */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
It is recommended, but not required, that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
If you don't wish to use a SVN utility, you can download a snapshot from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Build Options ===&lt;br /&gt;
&lt;br /&gt;
Unpack the wxWidgets zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory there is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9355</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=9355"/>
		<updated>2017-08-22T23:11:37Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Code::Blocks Sources */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
If you don't wish to use a SVN utility, you can download a snapshot from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Build Options ===&lt;br /&gt;
&lt;br /&gt;
Unpack the wxWidgets zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory there is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9354</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=9354"/>
		<updated>2017-08-22T23:11:12Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Code::Blocks Sources */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
If you don't wish to use a SVN utility, you can download a snapshot from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Build Options ===&lt;br /&gt;
&lt;br /&gt;
Unpack the wxWidgets zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory there is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9353</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=9353"/>
		<updated>2017-08-22T23:10:39Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Prerequisites */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.  If you don't wish to use a SVN utility, you can download a snapshot from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Build Options ===&lt;br /&gt;
&lt;br /&gt;
Unpack the wxWidgets zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory there is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9352</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=9352"/>
		<updated>2017-08-22T23:04:33Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Compile wxWidgets Library */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Build Options ===&lt;br /&gt;
&lt;br /&gt;
Unpack the wxWidgets zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory there is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9351</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=9351"/>
		<updated>2017-08-22T23:02:20Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Configure Build Options */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Build Options ===&lt;br /&gt;
&lt;br /&gt;
Unpack the wxWidgets zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory there is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Compile wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9350</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=9350"/>
		<updated>2017-08-22T23:01:28Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Configure Build Options */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Build Options ===&lt;br /&gt;
&lt;br /&gt;
Unpack the wxWidgets zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Compile wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9349</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=9349"/>
		<updated>2017-08-22T23:00:40Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Build wxWidgets Support Library */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
=== Configure Build Options ===&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Compile wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9348</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=9348"/>
		<updated>2017-08-22T22:58:20Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Build wxWidgets Support Library */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Compile wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9347</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=9347"/>
		<updated>2017-08-22T22:57:23Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Build wxWidgets Library */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Compile wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9346</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=9346"/>
		<updated>2017-08-22T22:56:38Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* wxWidgets Support Library */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9345</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=9345"/>
		<updated>2017-08-22T22:55:57Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Code::Blocks Sources */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
The last item is to acquire the Code::Blocks source code.  Follow the appropriate instructions for whether you have a graphical or command line SVN client.&lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9344</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=9344"/>
		<updated>2017-08-22T22:50:54Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Prerequisites */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9343</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=9343"/>
		<updated>2017-08-18T07:22:47Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* TortoiseSVN */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9342</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=9342"/>
		<updated>2017-08-18T07:19:09Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Compile contributed (or your own) plugins */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the &amp;quot;[http://www.boost.org/ Boost]&amp;quot; library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9341</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=9341"/>
		<updated>2017-08-18T07:17:48Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* wxWidgets */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the &amp;quot;[https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface toolkit]&amp;quot; that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9340</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=9340"/>
		<updated>2017-08-18T07:16:58Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* wxWidgets */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site ➡ [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9339</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=9339"/>
		<updated>2017-08-18T07:16:31Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* wxWidgets */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site → [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9338</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=9338"/>
		<updated>2017-08-18T07:16:00Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* wxWidgets */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9337</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=9337"/>
		<updated>2017-08-18T07:15:01Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* SVN */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install: [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9336</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=9336"/>
		<updated>2017-08-18T07:13:20Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Tips */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9335</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=9335"/>
		<updated>2017-08-09T22:12:01Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Compile contributed (or your own) plugins */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* ''Advanced'': 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9334</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=9334"/>
		<updated>2017-07-31T03:11:34Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Build wxWidgets Support Library */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* ''Advanced'': 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9333</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=9333"/>
		<updated>2017-07-30T04:50:24Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Build wxWidgets Support Library */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this directory is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* ''Advanced'': 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9332</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=9332"/>
		<updated>2017-07-30T04:50:05Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Build wxWidgets Support Library */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the directory &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this folder is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* ''Advanced'': 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9331</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=9331"/>
		<updated>2017-07-30T04:48:49Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Tips */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the folder &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this folder is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* ''Advanced'': 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9330</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=9330"/>
		<updated>2017-07-30T04:48:01Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Tips */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the folder &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this folder is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* Advanced: 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9329</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=9329"/>
		<updated>2017-07-30T04:45:47Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Build wxWidgets Support Library */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the folder &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this folder is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&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;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* Advanced: 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9328</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=9328"/>
		<updated>2017-07-30T04:44:45Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* wxWidgets */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the folder &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this folder is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
&lt;br /&gt;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* Advanced: 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9327</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=9327"/>
		<updated>2017-07-30T04:44:10Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* wxWidgets */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&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;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the folder &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this folder is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
&lt;br /&gt;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* Advanced: 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9326</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=9326"/>
		<updated>2017-07-28T18:44:13Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Build wxWidgets Library */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download wxWidgets 2.8.12:&lt;br /&gt;
&lt;br /&gt;
* wxWidgets 2.8.12 &amp;lt;br/&amp;gt;Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&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;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the folder &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this folder is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
&lt;br /&gt;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* Advanced: 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9325</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=9325"/>
		<updated>2017-07-28T08:04:41Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Build wxWidgets Support Library */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download wxWidgets 2.8.12:&lt;br /&gt;
&lt;br /&gt;
* wxWidgets 2.8.12 &amp;lt;br/&amp;gt;Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&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;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the folder &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this folder is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug #269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your root toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
&lt;br /&gt;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* Advanced: 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9324</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=9324"/>
		<updated>2017-07-28T08:02:34Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Build wxWidgets Support Library */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download wxWidgets 2.8.12:&lt;br /&gt;
&lt;br /&gt;
* wxWidgets 2.8.12 &amp;lt;br/&amp;gt;Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&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;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the folder &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this folder is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
Some versions of the MinGW Windows Runtime Library will cause an error during compilation.  See: [https://sourceforge.net/p/tdm-gcc/bugs/269/ Bug# 269].  If this is the case with the toolchain you are using then try this workaround:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your root toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
&lt;br /&gt;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* Advanced: 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9323</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=9323"/>
		<updated>2017-07-28T01:58:42Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* wxWidgets */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] toolkit that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download wxWidgets 2.8.12:&lt;br /&gt;
&lt;br /&gt;
* wxWidgets 2.8.12 &amp;lt;br/&amp;gt;Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&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;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the folder &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this folder is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
If your compiler errors out, usually referencing monotree.dll or similar:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your root toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
&lt;br /&gt;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* Advanced: 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9322</id>
		<title>MinGW installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9322"/>
		<updated>2017-07-27T08:51:49Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Documentation]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
A compiler toolchain is what Code::Blocks uses to turn the code you type into it into numbers that the computer understands.  As a compiler toolchain is a very complex undertaking it is not part of Code::Blocks itself but rather is a separate project that Code::Blocks then uses.  The kind of compiler toolchains talked about on this page are &amp;quot;MinGW&amp;quot; toolchains.  Which means &amp;quot;Minimalist GNU for Windows.&amp;quot;  And &amp;quot;GNU&amp;quot; expands to &amp;quot;GNU's Not Unix.&amp;quot;  More information about the GNU project can be found on the [https://www.gnu.org/home.en.html GNU Home Page].&lt;br /&gt;
&lt;br /&gt;
For most MinGW-based compiler toolchains, having your toolchain in your PATH is important because it means that during development the toolchain libraries will be accessible by default to your programs as you develop them and also makes it easier to use utilities such as [https://cmake.org/ CMake] as they will be able to find your compiler toolchain.  When you actually distribute your programs to other computers then you will copy the needed .dll files out of your toolchain directory and include them as part of your installer.  On your machine they are in your PATH so you always have them, on your users computers they won't have the compiler toolchain so there you provide the .dll files with your program.&lt;br /&gt;
&lt;br /&gt;
== TDM-GCC ==&lt;br /&gt;
&lt;br /&gt;
[http://tdm-gcc.tdragon.net/ TDM-GCC] is the toolchain that will be used as the example for this guide.  TDM-GCC statically links the required toolchain libraries into your final executable.  Which means that when you create your installer for your final program there are less files to include - they are built into your executable itself.  The Code::Blocks team recommends TDM-GCC.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Download the on-demand installer and run it.&lt;br /&gt;
&lt;br /&gt;
Go through the installation pages, the red arrows are all the default options which we will be keeping and the last blue arrow is to indicate that you will be putting TDM-GCC into your system's PATH.  &lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Create.png]] [[Image:TDM_Arch.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Inst_Dir.png]] [[Image:TDM_Inst_Options.png]]&lt;br /&gt;
&lt;br /&gt;
Once you are ready, click Install to proceed.&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Configuration ===&lt;br /&gt;
&lt;br /&gt;
Go to your Compiler settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And then under the &amp;quot;Toolchain executables&amp;quot; tab (red arrow), click on the ellipsis (&amp;quot;...&amp;quot;, blue arrow) and choose the root directory where you installed TDM-GCC 32-bit.  Once you have that directory chosen, in the &amp;quot;Program Files&amp;quot; sub-tab (green arrow) area fill out the fields as shown.  If you aren't using the TDM-GCC toolchain there might be minor variation in the executable names.  If you choose the blue arrow ellipsis ''first'' then for each ellipsis you click on under &amp;quot;Program Files&amp;quot; you will already be in your TDM-GCC &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory where the actual programs are.&lt;br /&gt;
&lt;br /&gt;
[[Image:CB_TDM_Toolchain.png]]&lt;br /&gt;
&lt;br /&gt;
Now, go to your Debugger settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Settings_Debugger.png]]&lt;br /&gt;
&lt;br /&gt;
Choose your default debugger (red arrow), and then fill in the Executable path for it as shown for TDM-GCC 32-bit (blue arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Debugger_Default.png]]&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
You now have a Code::Blocks environment that is configured to use TDM-GCC 32-bit properly.  Using this guide as a template you can easily set up alternative compiler toolchains no matter the source - just follow the same basic procedure.&lt;br /&gt;
&lt;br /&gt;
== Alternative MinGW Compiler Toolchains ==&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org/ MinGW] - The original project.&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/mingw-w64/files/ MinGW-Builds] ➡ In, &amp;quot;Toolchains targeting Win32 or Win64,&amp;quot; ➡ &amp;quot;Personal Builds,&amp;quot; ➡ &amp;quot;mingw-builds,&amp;quot; ➡ Version, ➡ Threading Model, ➡ Exception Model, ➡ Revision.&lt;br /&gt;
&lt;br /&gt;
[http://mingw-w64.org/doku.php Mingw-w64] - The parent project of MinGW-Builds, includes much more than is necessary - MinGW-Builds will usually suffice instead of the full works.&lt;br /&gt;
&lt;br /&gt;
[http://www.equation.com/servlet/equation.cmd?fa=fortran MinGW Equation] - A package that also provides OpenMP.&lt;br /&gt;
&lt;br /&gt;
==Development Tools==&lt;br /&gt;
&lt;br /&gt;
Normally you should not need many of these tools.  ZIP is convenient, especially when: [[Installing_Code::Blocks_from_source_on_Windows | building Code::Blocks itself]], but other than that these tools only serve specialized purposes.&lt;br /&gt;
&lt;br /&gt;
===UnxUtils===&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/unxutils/ UnxUtils]&lt;br /&gt;
&lt;br /&gt;
===GnuWin32===&lt;br /&gt;
&lt;br /&gt;
*[https://sourceforge.net/projects/gnuwin32/ GnuWin32]&lt;br /&gt;
&lt;br /&gt;
===ZIP===&lt;br /&gt;
*[ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn.zip zip-3.0.0 32-bit] or [ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn-x64.zip zip-3.0.0 64-bit]&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9321</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=9321"/>
		<updated>2017-07-27T08:49:04Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Build wxWidgets Support Library */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] system that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download wxWidgets 2.8.12:&lt;br /&gt;
&lt;br /&gt;
* wxWidgets 2.8.12 &amp;lt;br/&amp;gt;Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&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;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the folder &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this folder is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
If your compiler errors out, usually referencing monotree.dll or similar:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  This would be useful for your own 64-bit programs but the Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your root toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
&lt;br /&gt;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* Advanced: 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9320</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=9320"/>
		<updated>2017-07-27T08:45:36Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* MinGW Compiler */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] system that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download wxWidgets 2.8.12:&lt;br /&gt;
&lt;br /&gt;
* wxWidgets 2.8.12 &amp;lt;br/&amp;gt;Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&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;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the folder &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this folder is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
If your compiler errors out, usually referencing monotree.dll or similar:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  However, there is no point to it.  The Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your root toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
&lt;br /&gt;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* Advanced: 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=9319</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=9319"/>
		<updated>2017-07-27T08:45:15Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* MinGW Compiler */&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;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
=== Self-Hosting ===&lt;br /&gt;
&lt;br /&gt;
The build process described on this page is a kind of &amp;quot;[https://en.wikipedia.org/wiki/Self-hosting Self-Hosting].&amp;quot;  You use an existing version of Code::Blocks to compile the next version.  When that version is proven to function correctly it is used to compile the next, and so on.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Bootstrap Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
A properly working Code::Blocks is required to compile the next SVN version.  A: [[Installing_Code::Blocks_nightly_build_on_Windows | Nightly Build]] is a good candidate to use.  It will be paired with a MinGW compiler in the next item.&lt;br /&gt;
&lt;br /&gt;
=== MinGW Compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with a MinGW Compiler toolchain on Windows. You will need a complete, working: [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
=== Utilities ===&lt;br /&gt;
&lt;br /&gt;
ZIP and SVN functions are not required to run Code::Blocks but ZIP is required to build it and a SVN client is strongly recommended but not absolutely necessary.&lt;br /&gt;
&lt;br /&gt;
==== ZIP ====&lt;br /&gt;
&lt;br /&gt;
You will need a command-line &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; program.  The recommended one can be found on the: [[MinGW installation#Development Tools|Development Tools]] page.  You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;zip.exe&amp;lt;/tt&amp;gt; is in your PATH as it is used both during the compilation in your current version of Code::Blocks and also by the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
==== SVN ====&lt;br /&gt;
&lt;br /&gt;
You can either download the Code::Blocks source from: http://sourceforge.net/p/codeblocks/code ➡ &amp;quot;Download Snapshot&amp;quot; or use an SVN Client to checkout the code.&lt;br /&gt;
&lt;br /&gt;
It is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine if you would like an all-in-one SVN solution. ''TortoiseSVN'' includes optional command-line client tools,  which you should install as they provide a command-line SVN client.  Choosing to install the command-line client tools will automatically add them to your PATH.  However, if you do not wish to have the ''TortoiseSVN'' Explorer extensions in your right-click context menu or just don't feel a need for a graphical client in particular then you can use another: [http://subversion.apache.org/packages.html SVN command-line client] equally well.  Just make sure that whichever client you install has its executable in your PATH.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn.exe&amp;lt;/tt&amp;gt; binary if it is available (in your PATH) and also uses the SVN meta-data generated by a SVN checkout.  If you have both a SVN command-line client in your PATH, and the meta-data, the resulting build of Code::Blocks will show the revision on the loading splash window, the Start here page, and in the About dialog (shown here in the About dialog, indicated by the red arrow):&lt;br /&gt;
&lt;br /&gt;
[[Image:About_SVN10627.png]]&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
wxWidgets is the [https://en.wikipedia.org/wiki/Graphical_user_interface graphical user interface] system that Code::Blocks is built on top of.&lt;br /&gt;
&lt;br /&gt;
For information about wxWidgets, see their official site: [http://www.wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Download wxWidgets 2.8.12:&lt;br /&gt;
&lt;br /&gt;
* wxWidgets 2.8.12 &amp;lt;br/&amp;gt;Download: [https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxMSW-2.8.12.zip wxMSW-2.8.12.zip]&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;
=== Code::Blocks Sources ===&lt;br /&gt;
&lt;br /&gt;
Finally, you will need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
==== TortoiseSVN ====&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical SVN client you can use ''TortoiseSVN'' - make a directory where you want to store the sources, right-click on the directory, and select &amp;quot;'''SVN Checkout''',&amp;quot; and as shown you will get a checkout dialog:&lt;br /&gt;
&lt;br /&gt;
[[Image:Tor_SVN.png]]&lt;br /&gt;
&lt;br /&gt;
In the URL of the repository box, enter svn://svn.code.sf.net/p/codeblocks/code/trunk and verify the checkout directory is where you would like it to be.  The example given here is &amp;quot;''C:\cb_svn''&amp;quot; - once satisfied with the arguments click the OK button to process the checkout.&lt;br /&gt;
&lt;br /&gt;
==== Command-Line SVN ====&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use a graphical SVN client then a command-line equivalent to the above is to use the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; command - open a command prompt, make a directory, change into that directory, and then checkout a copy of the repository:&lt;br /&gt;
&lt;br /&gt;
 mkdir codeblocks-head&lt;br /&gt;
 cd codeblocks-head&lt;br /&gt;
 svn checkout &amp;lt;nowiki&amp;gt;svn://svn.code.sf.net/p/codeblocks/code/trunk&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build wxWidgets Support Library ==&lt;br /&gt;
&lt;br /&gt;
Unpack the zip file to a directory of your choice, open a command-line prompt, and navigate to the folder &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; inside the wxWidgets directory.  In this folder is a text file named &amp;lt;tt&amp;gt;config.gcc&amp;lt;/tt&amp;gt; which you can edit with notepad to control the build options.  There are two lines to note, &amp;lt;tt&amp;gt;CFLAGS ?=&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS ?=&amp;lt;/tt&amp;gt;.  The options given here will go in either or both of those lines.&lt;br /&gt;
&lt;br /&gt;
If your linker runs out of memory while building use:&lt;br /&gt;
&lt;br /&gt;
 -fno-keep-inline-dllexport&lt;br /&gt;
&lt;br /&gt;
If your compiler errors out, usually referencing monotree.dll or similar:&lt;br /&gt;
&lt;br /&gt;
 -D_WIN32_IE=0x0603&lt;br /&gt;
&lt;br /&gt;
To silence warnings that can significantly slow down the compilation process:&lt;br /&gt;
&lt;br /&gt;
 -Wno-unused-local-typedefs&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
All of these options apply to both &amp;lt;tt&amp;gt;CFLAGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CXXFLAGS&amp;lt;/tt&amp;gt; so the two lines containing all the options would look like this:&lt;br /&gt;
&lt;br /&gt;
  CFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
  CXXFLAGS ?= -fno-keep-inline-dllexport -D_WIN32_IE=0x0603 -Wno-unused-local-typedefs -Wno-deprecated-declarations&lt;br /&gt;
&lt;br /&gt;
wxWidgets 2.8.12 will not compile by default with a 64-bit compiler.  To make it compile with one add &amp;lt;tt&amp;gt;CFG=64&amp;lt;/tt&amp;gt; to the build line that is given next.  However, there is no point to it.  The Code::Blocks project files do not have a 64-bit project that targets wxWidgets 2.8.12.  To attempt to modify them so they do is beyond the scope of this guide.&lt;br /&gt;
&lt;br /&gt;
=== Build wxWidgets Library ===&lt;br /&gt;
&lt;br /&gt;
At a command-line, inside the &amp;lt;tt&amp;gt;build/msw&amp;lt;/tt&amp;gt; directory, use the following commands to build wxWidgets:&lt;br /&gt;
&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
 mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
If your compiler toolchain is not in your PATH, it should be on a development machine, then put it in your path first:&lt;br /&gt;
&lt;br /&gt;
 set PATH=X:\path\to\toolchain\bin;%PATH%&lt;br /&gt;
&lt;br /&gt;
Where &amp;quot;'''''X'''''&amp;quot; is the drive letter, and &amp;quot;'''''\path\to\toolchain\bin'''''&amp;quot; is where your root toolchain is located. &lt;br /&gt;
&lt;br /&gt;
If your compilation fails for any reason then make sure to run the ''clean'' line before trying again.&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
&lt;br /&gt;
* If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.  ''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; with &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
* Advanced: 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 &amp;lt;tt&amp;gt;setup.h&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;lib/gcc_dll/msw/wx&amp;lt;/tt&amp;gt; before building, because your changes to &amp;lt;tt&amp;gt;include/wx/msw&amp;lt;/tt&amp;gt; will otherwise not be honored.&lt;br /&gt;
&lt;br /&gt;
== Build Code::Blocks ==&lt;br /&gt;
All the preparation work is now complete and we can actually perform a self-hosting compile of the next Code::Blocks with our current one.  If you do not make any changes to your non-Code::Blocks prepared items, like your MinGW compiler version, and the wxWidgets library, then when building subsequent SVN versions of Code::Blocks you can keep all the preparation from a previous build and start with this section.  When restarting from this point you can refresh your current Code::Blocks local source with ''TortoiseSVN''.  Right-click on your local source directory, go to &amp;quot;TortoiseSVN&amp;quot; in the context-menu, then choose &amp;quot;update to revision.&amp;quot;  The &amp;quot;head&amp;quot; is always the latest version.  If you are using a command-line SVN, just run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; in the root of your local source directory.&lt;br /&gt;
&lt;br /&gt;
=== Open project ===&lt;br /&gt;
Open the project file '''CodeBlocks.cbp'''. &lt;br /&gt;
*You will be prompted to define the global variable $(#wx). In the base field, enter the root of the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
*You will also be prompted to enter the global variable '''cb_release_type'''. Here you can add compiler optimization or debug-flags. Enter '''-g''' in the '''base''' field as a default or any other options you require for your specific needs.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_Variables.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_wx.png]]&lt;br /&gt;
&lt;br /&gt;
=== Prevent unnecessary warnings ===&lt;br /&gt;
&lt;br /&gt;
Building Code::Blocks against the wxWidgets library will generate an excessive amount of warnings during the compilation. This can significantly impact the time it takes to compile both the main project and the contributors workspace as each warning has to be printed to the build log.  To silence these warnings, go to Compiler Settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And under the &amp;quot;Compiler settings&amp;quot; tab (red arrow), &amp;quot;Other compiler options&amp;quot; sub-tab (green arrow), enter &amp;quot;&amp;lt;tt&amp;gt;-Wno-unused-local-typedefs&amp;lt;/tt&amp;gt;&amp;quot; (blue arrow), and you may also add &amp;quot;&amp;lt;tt&amp;gt;-Wno-deprecated-declarations&amp;lt;/tt&amp;gt;&amp;quot; on its own line here too.&lt;br /&gt;
&lt;br /&gt;
[[Image:Unused_Local_Typedefs.png]]&lt;br /&gt;
&lt;br /&gt;
=== Compile project ===&lt;br /&gt;
Make sure that &amp;quot;All&amp;quot; is selected as the target (blue arrow), and then click the Build icon (red arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Compile_All.png]]&lt;br /&gt;
&lt;br /&gt;
If everything builds correctly your build messages should end with no errors.&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Log.png]]&lt;br /&gt;
&lt;br /&gt;
=== Copy wxWidgets support DLL ===&lt;br /&gt;
After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory in the Code::Blocks &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Devel_Output.png]]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory is created by compiling the Code::Blocks project in Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
=== Generate Production Output ===&lt;br /&gt;
Run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; (located in the &amp;lt;tt&amp;gt;src&amp;lt;/tt&amp;gt; directory). This will pack the resource files and copy the executables, libraries, and plugins to the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory.  It will also create the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory if it does not exist.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
[[Image:Update_Output.png]]&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 Build menu if you want them all).&lt;br /&gt;
&lt;br /&gt;
The NassiShneiderman plugin has a dependency on the [http://www.boost.org/ Boost] library.  If you do not wish to use that plugin and therefore not need the library, just right-click on that plugin and choose &amp;quot;close project.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Image:Build_Workspace.png]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; again after building the contributed plugins.&lt;br /&gt;
&lt;br /&gt;
== Install Code::Blocks ==&lt;br /&gt;
&lt;br /&gt;
Copy or move the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to where you want Code::Blocks to reside.  You probably want to rename the &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; directory to something else.  You can also optionally right-click on &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; and choose &amp;quot;create shortcut&amp;quot; and then rename that shortcut to your liking and move it to another location such as your desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
If you want to run Code::Blocks on a machine without your compiler toolchain being in the PATH then you will likely have to include, in the same directory as the &amp;lt;tt&amp;gt;codeblocks.exe&amp;lt;/tt&amp;gt; is fine, support .dll files from your compiler toolchain.  The easiest way to determine the required files is to not have your compiler toolchain in your PATH and repeatedly run Code::Blocks and copy over each .dll it says is missing until all have been found.&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9318</id>
		<title>MinGW installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9318"/>
		<updated>2017-07-27T08:29:44Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* TDM-GCC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Documentation]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
A compiler toolchain is what Code::Blocks uses to turn the code you type into it into numbers that the computer understands.  As a compiler toolchain is a very complex undertaking it is not part of Code::Blocks itself but rather is a separate project that Code::Blocks then uses.  The kind of compiler toolchains talked about on this page are &amp;quot;MinGW&amp;quot; toolchains.  That means &amp;quot;Minimalist GNU for Windows.&amp;quot;  And &amp;quot;GNU&amp;quot; expands to &amp;quot;GNU's Not Unix.&amp;quot;  More information about the GNU project can be found on the [https://www.gnu.org/home.en.html GNU Home Page].&lt;br /&gt;
&lt;br /&gt;
For most MinGW-based compiler toolchains, having your toolchain in your PATH is important because it means that during development the toolchain libraries will be accessible by default to your programs as you develop them and also makes it easier to use utilities such as [https://cmake.org/ CMake] as they will be able to find your compiler toolchain.  When you actually distribute your programs to other computers then you will copy the needed .dll files out of your toolchain directory and include them as part of your installer.  On your machine they are in your PATH so you always have them, on your users computers they won't have the compiler toolchain so there you provide the .dll files with your program.&lt;br /&gt;
&lt;br /&gt;
== TDM-GCC ==&lt;br /&gt;
&lt;br /&gt;
[http://tdm-gcc.tdragon.net/ TDM-GCC] is the toolchain that will be used as the example for this guide.  TDM-GCC statically links the required toolchain libraries into your final executable.  Which means that when you create your installer for your final program there are less files to include - they are built into your executable itself.  The Code::Blocks team recommends TDM-GCC.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Download the on-demand installer and run it.&lt;br /&gt;
&lt;br /&gt;
Go through the installation pages, the red arrows are all the default options which we will be keeping and the last blue arrow is to indicate that you will be putting TDM-GCC into your system's PATH.  &lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Create.png]] [[Image:TDM_Arch.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Inst_Dir.png]] [[Image:TDM_Inst_Options.png]]&lt;br /&gt;
&lt;br /&gt;
Once you are ready, click Install to proceed.&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Configuration ===&lt;br /&gt;
&lt;br /&gt;
Go to your Compiler settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And then under the &amp;quot;Toolchain executables&amp;quot; tab (red arrow), click on the ellipsis (&amp;quot;...&amp;quot;, blue arrow) and choose the root directory where you installed TDM-GCC 32-bit.  Once you have that directory chosen, in the &amp;quot;Program Files&amp;quot; sub-tab (green arrow) area fill out the fields as shown.  If you aren't using the TDM-GCC toolchain there might be minor variation in the executable names.  If you choose the blue arrow ellipsis ''first'' then for each ellipsis you click on under &amp;quot;Program Files&amp;quot; you will already be in your TDM-GCC &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory where the actual programs are.&lt;br /&gt;
&lt;br /&gt;
[[Image:CB_TDM_Toolchain.png]]&lt;br /&gt;
&lt;br /&gt;
Now, go to your Debugger settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Settings_Debugger.png]]&lt;br /&gt;
&lt;br /&gt;
Choose your default debugger (red arrow), and then fill in the Executable path for it as shown for TDM-GCC 32-bit (blue arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Debugger_Default.png]]&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
You now have a Code::Blocks environment that is configured to use TDM-GCC 32-bit properly.  Using this guide as a template you can easily set up alternative compiler toolchains no matter the source - just follow the same basic procedure.&lt;br /&gt;
&lt;br /&gt;
== Alternative MinGW Compiler Toolchains ==&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org/ MinGW] - The original project.&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/mingw-w64/files/ MinGW-Builds] ➡ In, &amp;quot;Toolchains targeting Win32 or Win64,&amp;quot; ➡ &amp;quot;Personal Builds,&amp;quot; ➡ &amp;quot;mingw-builds,&amp;quot; ➡ Version, ➡ Threading Model, ➡ Exception Model, ➡ Revision.&lt;br /&gt;
&lt;br /&gt;
[http://mingw-w64.org/doku.php Mingw-w64] - The parent project of MinGW-Builds, includes much more than is necessary - MinGW-Builds will usually suffice instead of the full works.&lt;br /&gt;
&lt;br /&gt;
[http://www.equation.com/servlet/equation.cmd?fa=fortran MinGW Equation] - A package that also provides OpenMP.&lt;br /&gt;
&lt;br /&gt;
==Development Tools==&lt;br /&gt;
&lt;br /&gt;
Normally you should not need many of these tools.  ZIP is convenient, especially when: [[Installing_Code::Blocks_from_source_on_Windows | building Code::Blocks itself]], but other than that these tools only serve specialized purposes.&lt;br /&gt;
&lt;br /&gt;
===UnxUtils===&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/unxutils/ UnxUtils]&lt;br /&gt;
&lt;br /&gt;
===GnuWin32===&lt;br /&gt;
&lt;br /&gt;
*[https://sourceforge.net/projects/gnuwin32/ GnuWin32]&lt;br /&gt;
&lt;br /&gt;
===ZIP===&lt;br /&gt;
*[ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn.zip zip-3.0.0 32-bit] or [ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn-x64.zip zip-3.0.0 64-bit]&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9317</id>
		<title>MinGW installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9317"/>
		<updated>2017-07-27T08:29:22Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* TDM-GCC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Documentation]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
A compiler toolchain is what Code::Blocks uses to turn the code you type into it into numbers that the computer understands.  As a compiler toolchain is a very complex undertaking it is not part of Code::Blocks itself but rather is a separate project that Code::Blocks then uses.  The kind of compiler toolchains talked about on this page are &amp;quot;MinGW&amp;quot; toolchains.  That means &amp;quot;Minimalist GNU for Windows.&amp;quot;  And &amp;quot;GNU&amp;quot; expands to &amp;quot;GNU's Not Unix.&amp;quot;  More information about the GNU project can be found on the [https://www.gnu.org/home.en.html GNU Home Page].&lt;br /&gt;
&lt;br /&gt;
For most MinGW-based compiler toolchains, having your toolchain in your PATH is important because it means that during development the toolchain libraries will be accessible by default to your programs as you develop them and also makes it easier to use utilities such as [https://cmake.org/ CMake] as they will be able to find your compiler toolchain.  When you actually distribute your programs to other computers then you will copy the needed .dll files out of your toolchain directory and include them as part of your installer.  On your machine they are in your PATH so you always have them, on your users computers they won't have the compiler toolchain so there you provide the .dll files with your program.&lt;br /&gt;
&lt;br /&gt;
== TDM-GCC ==&lt;br /&gt;
&lt;br /&gt;
[http://tdm-gcc.tdragon.net/ TDM-GCC] is the toolchain that will be used as the example for this guide.  TDM-GCC statically links the required toolchain libraries into your final executable.  Which means that when you create your installer for your final program there are less files to include - they are built into your executable itself.  The Code::Blocks team recommends TDM builds of MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Download the on-demand installer and run it.&lt;br /&gt;
&lt;br /&gt;
Go through the installation pages, the red arrows are all the default options which we will be keeping and the last blue arrow is to indicate that you will be putting TDM-GCC into your system's PATH.  &lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Create.png]] [[Image:TDM_Arch.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Inst_Dir.png]] [[Image:TDM_Inst_Options.png]]&lt;br /&gt;
&lt;br /&gt;
Once you are ready, click Install to proceed.&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Configuration ===&lt;br /&gt;
&lt;br /&gt;
Go to your Compiler settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And then under the &amp;quot;Toolchain executables&amp;quot; tab (red arrow), click on the ellipsis (&amp;quot;...&amp;quot;, blue arrow) and choose the root directory where you installed TDM-GCC 32-bit.  Once you have that directory chosen, in the &amp;quot;Program Files&amp;quot; sub-tab (green arrow) area fill out the fields as shown.  If you aren't using the TDM-GCC toolchain there might be minor variation in the executable names.  If you choose the blue arrow ellipsis ''first'' then for each ellipsis you click on under &amp;quot;Program Files&amp;quot; you will already be in your TDM-GCC &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory where the actual programs are.&lt;br /&gt;
&lt;br /&gt;
[[Image:CB_TDM_Toolchain.png]]&lt;br /&gt;
&lt;br /&gt;
Now, go to your Debugger settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Settings_Debugger.png]]&lt;br /&gt;
&lt;br /&gt;
Choose your default debugger (red arrow), and then fill in the Executable path for it as shown for TDM-GCC 32-bit (blue arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Debugger_Default.png]]&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
You now have a Code::Blocks environment that is configured to use TDM-GCC 32-bit properly.  Using this guide as a template you can easily set up alternative compiler toolchains no matter the source - just follow the same basic procedure.&lt;br /&gt;
&lt;br /&gt;
== Alternative MinGW Compiler Toolchains ==&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org/ MinGW] - The original project.&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/mingw-w64/files/ MinGW-Builds] ➡ In, &amp;quot;Toolchains targeting Win32 or Win64,&amp;quot; ➡ &amp;quot;Personal Builds,&amp;quot; ➡ &amp;quot;mingw-builds,&amp;quot; ➡ Version, ➡ Threading Model, ➡ Exception Model, ➡ Revision.&lt;br /&gt;
&lt;br /&gt;
[http://mingw-w64.org/doku.php Mingw-w64] - The parent project of MinGW-Builds, includes much more than is necessary - MinGW-Builds will usually suffice instead of the full works.&lt;br /&gt;
&lt;br /&gt;
[http://www.equation.com/servlet/equation.cmd?fa=fortran MinGW Equation] - A package that also provides OpenMP.&lt;br /&gt;
&lt;br /&gt;
==Development Tools==&lt;br /&gt;
&lt;br /&gt;
Normally you should not need many of these tools.  ZIP is convenient, especially when: [[Installing_Code::Blocks_from_source_on_Windows | building Code::Blocks itself]], but other than that these tools only serve specialized purposes.&lt;br /&gt;
&lt;br /&gt;
===UnxUtils===&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/unxutils/ UnxUtils]&lt;br /&gt;
&lt;br /&gt;
===GnuWin32===&lt;br /&gt;
&lt;br /&gt;
*[https://sourceforge.net/projects/gnuwin32/ GnuWin32]&lt;br /&gt;
&lt;br /&gt;
===ZIP===&lt;br /&gt;
*[ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn.zip zip-3.0.0 32-bit] or [ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn-x64.zip zip-3.0.0 64-bit]&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9316</id>
		<title>MinGW installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9316"/>
		<updated>2017-07-27T08:27:06Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Documentation]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
A compiler toolchain is what Code::Blocks uses to turn the code you type into it into numbers that the computer understands.  As a compiler toolchain is a very complex undertaking it is not part of Code::Blocks itself but rather is a separate project that Code::Blocks then uses.  The kind of compiler toolchains talked about on this page are &amp;quot;MinGW&amp;quot; toolchains.  That means &amp;quot;Minimalist GNU for Windows.&amp;quot;  And &amp;quot;GNU&amp;quot; expands to &amp;quot;GNU's Not Unix.&amp;quot;  More information about the GNU project can be found on the [https://www.gnu.org/home.en.html GNU Home Page].&lt;br /&gt;
&lt;br /&gt;
For most MinGW-based compiler toolchains, having your toolchain in your PATH is important because it means that during development the toolchain libraries will be accessible by default to your programs as you develop them and also makes it easier to use utilities such as [https://cmake.org/ CMake] as they will be able to find your compiler toolchain.  When you actually distribute your programs to other computers then you will copy the needed .dll files out of your toolchain directory and include them as part of your installer.  On your machine they are in your PATH so you always have them, on your users computers they won't have the compiler toolchain so there you provide the .dll files with your program.&lt;br /&gt;
&lt;br /&gt;
== TDM-GCC ==&lt;br /&gt;
&lt;br /&gt;
[http://tdm-gcc.tdragon.net/ TDM-GCC] is the toolchain that will be used as the example for this guide. The Code::Blocks team recommends TDM builds of MinGW.  TDM-GCC statically links the required toolchain libraries into your final executable.  Which means that when you create your installer for your final program there are less files to include - they are built into your executable itself.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Download the on-demand installer and run it.&lt;br /&gt;
&lt;br /&gt;
Go through the installation pages, the red arrows are all the default options which we will be keeping and the last blue arrow is to indicate that you will be putting TDM-GCC into your system's PATH.  &lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Create.png]] [[Image:TDM_Arch.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Inst_Dir.png]] [[Image:TDM_Inst_Options.png]]&lt;br /&gt;
&lt;br /&gt;
Once you are ready, click Install to proceed.&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Configuration ===&lt;br /&gt;
&lt;br /&gt;
Go to your Compiler settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And then under the &amp;quot;Toolchain executables&amp;quot; tab (red arrow), click on the ellipsis (&amp;quot;...&amp;quot;, blue arrow) and choose the root directory where you installed TDM-GCC 32-bit.  Once you have that directory chosen, in the &amp;quot;Program Files&amp;quot; sub-tab (green arrow) area fill out the fields as shown.  If you aren't using the TDM-GCC toolchain there might be minor variation in the executable names.  If you choose the blue arrow ellipsis ''first'' then for each ellipsis you click on under &amp;quot;Program Files&amp;quot; you will already be in your TDM-GCC &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory where the actual programs are.&lt;br /&gt;
&lt;br /&gt;
[[Image:CB_TDM_Toolchain.png]]&lt;br /&gt;
&lt;br /&gt;
Now, go to your Debugger settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Settings_Debugger.png]]&lt;br /&gt;
&lt;br /&gt;
Choose your default debugger (red arrow), and then fill in the Executable path for it as shown for TDM-GCC 32-bit (blue arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Debugger_Default.png]]&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
You now have a Code::Blocks environment that is configured to use TDM-GCC 32-bit properly.  Using this guide as a template you can easily set up alternative compiler toolchains no matter the source - just follow the same basic procedure.&lt;br /&gt;
&lt;br /&gt;
== Alternative MinGW Compiler Toolchains ==&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org/ MinGW] - The original project.&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/mingw-w64/files/ MinGW-Builds] ➡ In, &amp;quot;Toolchains targeting Win32 or Win64,&amp;quot; ➡ &amp;quot;Personal Builds,&amp;quot; ➡ &amp;quot;mingw-builds,&amp;quot; ➡ Version, ➡ Threading Model, ➡ Exception Model, ➡ Revision.&lt;br /&gt;
&lt;br /&gt;
[http://mingw-w64.org/doku.php Mingw-w64] - The parent project of MinGW-Builds, includes much more than is necessary - MinGW-Builds will usually suffice instead of the full works.&lt;br /&gt;
&lt;br /&gt;
[http://www.equation.com/servlet/equation.cmd?fa=fortran MinGW Equation] - A package that also provides OpenMP.&lt;br /&gt;
&lt;br /&gt;
==Development Tools==&lt;br /&gt;
&lt;br /&gt;
Normally you should not need many of these tools.  ZIP is convenient, especially when: [[Installing_Code::Blocks_from_source_on_Windows | building Code::Blocks itself]], but other than that these tools only serve specialized purposes.&lt;br /&gt;
&lt;br /&gt;
===UnxUtils===&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/unxutils/ UnxUtils]&lt;br /&gt;
&lt;br /&gt;
===GnuWin32===&lt;br /&gt;
&lt;br /&gt;
*[https://sourceforge.net/projects/gnuwin32/ GnuWin32]&lt;br /&gt;
&lt;br /&gt;
===ZIP===&lt;br /&gt;
*[ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn.zip zip-3.0.0 32-bit] or [ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn-x64.zip zip-3.0.0 64-bit]&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9315</id>
		<title>MinGW installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9315"/>
		<updated>2017-07-27T08:25:58Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Documentation]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
A compiler toolchain is what Code::Blocks uses to turn the code you type into it into numbers that the computer understands.  As a compiler toolchain is a very complex undertaking it is not part of Code::Blocks itself but rather is a separate project that Code::Blocks then uses.  The kind of compiler toolchains talked about on this page are &amp;quot;MinGW&amp;quot; toolchains.  That means &amp;quot;Minimalist GNU for Windows.&amp;quot;  And &amp;quot;GNU&amp;quot; expands to &amp;quot;GNU's Not Unix.&amp;quot;  More information about the GNU project can be foundon the [https://www.gnu.org/home.en.html GNU Home Page].&lt;br /&gt;
&lt;br /&gt;
For most MinGW-based compiler toolchains, having your toolchain in your PATH is important because it means that during development the toolchain libraries will be accessible by default to your programs as you develop them and also makes it easier to use utilities such as [https://cmake.org/ CMake] as they will be able to find your compiler toolchain.  When you actually distribute your programs to other computers then you will copy the needed .dll files out of your toolchain directory and include them as part of your installer.  On your machine they are in your PATH so you always have them, on your users computers they won't have the compiler toolchain so there you provide the .dll files with your program.&lt;br /&gt;
&lt;br /&gt;
== TDM-GCC ==&lt;br /&gt;
&lt;br /&gt;
[http://tdm-gcc.tdragon.net/ TDM-GCC] is the toolchain that will be used as the example for this guide. The Code::Blocks team recommends TDM builds of MinGW.  TDM-GCC statically links the required toolchain libraries into your final executable.  Which means that when you create your installer for your final program there are less files to include - they are built into your executable itself.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Download the on-demand installer and run it.&lt;br /&gt;
&lt;br /&gt;
Go through the installation pages, the red arrows are all the default options which we will be keeping and the last blue arrow is to indicate that you will be putting TDM-GCC into your system's PATH.  &lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Create.png]] [[Image:TDM_Arch.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Inst_Dir.png]] [[Image:TDM_Inst_Options.png]]&lt;br /&gt;
&lt;br /&gt;
Once you are ready, click Install to proceed.&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Configuration ===&lt;br /&gt;
&lt;br /&gt;
Go to your Compiler settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And then under the &amp;quot;Toolchain executables&amp;quot; tab (red arrow), click on the ellipsis (&amp;quot;...&amp;quot;, blue arrow) and choose the root directory where you installed TDM-GCC 32-bit.  Once you have that directory chosen, in the &amp;quot;Program Files&amp;quot; sub-tab (green arrow) area fill out the fields as shown.  If you aren't using the TDM-GCC toolchain there might be minor variation in the executable names.  If you choose the blue arrow ellipsis ''first'' then for each ellipsis you click on under &amp;quot;Program Files&amp;quot; you will already be in your TDM-GCC &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory where the actual programs are.&lt;br /&gt;
&lt;br /&gt;
[[Image:CB_TDM_Toolchain.png]]&lt;br /&gt;
&lt;br /&gt;
Now, go to your Debugger settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Settings_Debugger.png]]&lt;br /&gt;
&lt;br /&gt;
Choose your default debugger (red arrow), and then fill in the Executable path for it as shown for TDM-GCC 32-bit (blue arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Debugger_Default.png]]&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
You now have a Code::Blocks environment that is configured to use TDM-GCC 32-bit properly.  Using this guide as a template you can easily set up alternative compiler toolchains no matter the source - just follow the same basic procedure.&lt;br /&gt;
&lt;br /&gt;
== Alternative MinGW Compiler Toolchains ==&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org/ MinGW] - The original project.&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/mingw-w64/files/ MinGW-Builds] ➡ In, &amp;quot;Toolchains targeting Win32 or Win64,&amp;quot; ➡ &amp;quot;Personal Builds,&amp;quot; ➡ &amp;quot;mingw-builds,&amp;quot; ➡ Version, ➡ Threading Model, ➡ Exception Model, ➡ Revision.&lt;br /&gt;
&lt;br /&gt;
[http://mingw-w64.org/doku.php Mingw-w64] - The parent project of MinGW-Builds, includes much more than is necessary - MinGW-Builds will usually suffice instead of the full works.&lt;br /&gt;
&lt;br /&gt;
[http://www.equation.com/servlet/equation.cmd?fa=fortran MinGW Equation] - A package that also provides OpenMP.&lt;br /&gt;
&lt;br /&gt;
==Development Tools==&lt;br /&gt;
&lt;br /&gt;
Normally you should not need many of these tools.  ZIP is convenient, especially when: [[Installing_Code::Blocks_from_source_on_Windows | building Code::Blocks itself]], but other than that these tools only serve specialized purposes.&lt;br /&gt;
&lt;br /&gt;
===UnxUtils===&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/unxutils/ UnxUtils]&lt;br /&gt;
&lt;br /&gt;
===GnuWin32===&lt;br /&gt;
&lt;br /&gt;
*[https://sourceforge.net/projects/gnuwin32/ GnuWin32]&lt;br /&gt;
&lt;br /&gt;
===ZIP===&lt;br /&gt;
*[ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn.zip zip-3.0.0 32-bit] or [ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn-x64.zip zip-3.0.0 64-bit]&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9314</id>
		<title>MinGW installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9314"/>
		<updated>2017-07-27T08:24:06Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Documentation]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
A compiler toolchain is what Code::Blocks uses to turn the code you type into it into numbers that the computer understands.  As a compiler toolchain is a very complex undertaking it is not part of Code::Blocks itself but rather is a separate project that Code::Blocks then uses.  The kind of compiler toolchains talked about on this page are &amp;quot;MinGW&amp;quot; toolchains.  That means &amp;quot;Minimalist GNU for Windows.&amp;quot;  And &amp;quot;GNU&amp;quot; expands to &amp;quot;GNU's Not Unix.&amp;quot;  More information about the GNU project can be found: [https://www.gnu.org/home.en.html here].&lt;br /&gt;
&lt;br /&gt;
For most MinGW-based compiler toolchains, having your toolchain in your PATH is important because it means that during development the toolchain libraries will be accessible by default to your programs as you develop them and also makes it easier to use utilities such as [https://cmake.org/ CMake] as they will be able to find your compiler toolchain.  When you actually distribute your programs to other computers then you will copy the needed .dll files out of your toolchain directory and include them as part of your installer.  On your machine they are in your PATH so you always have them, on your users computers they won't have the compiler toolchain so there you provide the .dll files with your program.&lt;br /&gt;
&lt;br /&gt;
== TDM-GCC ==&lt;br /&gt;
&lt;br /&gt;
[http://tdm-gcc.tdragon.net/ TDM-GCC] is the toolchain that will be used as the example for this guide. The Code::Blocks team recommends TDM builds of MinGW.  TDM-GCC statically links the required toolchain libraries into your final executable.  Which means that when you create your installer for your final program there are less files to include - they are built into your executable itself.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Download the on-demand installer and run it.&lt;br /&gt;
&lt;br /&gt;
Go through the installation pages, the red arrows are all the default options which we will be keeping and the last blue arrow is to indicate that you will be putting TDM-GCC into your system's PATH.  &lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Create.png]] [[Image:TDM_Arch.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Inst_Dir.png]] [[Image:TDM_Inst_Options.png]]&lt;br /&gt;
&lt;br /&gt;
Once you are ready, click Install to proceed.&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Configuration ===&lt;br /&gt;
&lt;br /&gt;
Go to your Compiler settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And then under the &amp;quot;Toolchain executables&amp;quot; tab (red arrow), click on the ellipsis (&amp;quot;...&amp;quot;, blue arrow) and choose the root directory where you installed TDM-GCC 32-bit.  Once you have that directory chosen, in the &amp;quot;Program Files&amp;quot; sub-tab (green arrow) area fill out the fields as shown.  If you aren't using the TDM-GCC toolchain there might be minor variation in the executable names.  If you choose the blue arrow ellipsis ''first'' then for each ellipsis you click on under &amp;quot;Program Files&amp;quot; you will already be in your TDM-GCC &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory where the actual programs are.&lt;br /&gt;
&lt;br /&gt;
[[Image:CB_TDM_Toolchain.png]]&lt;br /&gt;
&lt;br /&gt;
Now, go to your Debugger settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Settings_Debugger.png]]&lt;br /&gt;
&lt;br /&gt;
Choose your default debugger (red arrow), and then fill in the Executable path for it as shown for TDM-GCC 32-bit (blue arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Debugger_Default.png]]&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
You now have a Code::Blocks environment that is configured to use TDM-GCC 32-bit properly.  Using this guide as a template you can easily set up alternative compiler toolchains no matter the source - just follow the same basic procedure.&lt;br /&gt;
&lt;br /&gt;
== Alternative MinGW Compiler Toolchains ==&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org/ MinGW] - The original project.&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/mingw-w64/files/ MinGW-Builds] ➡ In, &amp;quot;Toolchains targeting Win32 or Win64,&amp;quot; ➡ &amp;quot;Personal Builds,&amp;quot; ➡ &amp;quot;mingw-builds,&amp;quot; ➡ Version, ➡ Threading Model, ➡ Exception Model, ➡ Revision.&lt;br /&gt;
&lt;br /&gt;
[http://mingw-w64.org/doku.php Mingw-w64] - The parent project of MinGW-Builds, includes much more than is necessary - MinGW-Builds will usually suffice instead of the full works.&lt;br /&gt;
&lt;br /&gt;
[http://www.equation.com/servlet/equation.cmd?fa=fortran MinGW Equation] - A package that also provides OpenMP.&lt;br /&gt;
&lt;br /&gt;
==Development Tools==&lt;br /&gt;
&lt;br /&gt;
Normally you should not need many of these tools.  ZIP is convenient, especially when: [[Installing_Code::Blocks_from_source_on_Windows | building Code::Blocks itself]], but other than that these tools only serve specialized purposes.&lt;br /&gt;
&lt;br /&gt;
===UnxUtils===&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/unxutils/ UnxUtils]&lt;br /&gt;
&lt;br /&gt;
===GnuWin32===&lt;br /&gt;
&lt;br /&gt;
*[https://sourceforge.net/projects/gnuwin32/ GnuWin32]&lt;br /&gt;
&lt;br /&gt;
===ZIP===&lt;br /&gt;
*[ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn.zip zip-3.0.0 32-bit] or [ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn-x64.zip zip-3.0.0 64-bit]&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9313</id>
		<title>MinGW installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9313"/>
		<updated>2017-07-27T08:22:54Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* TDM-GCC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Documentation]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
A compiler toolchain is what Code::Blocks uses to turn the code you type into it into numbers that the computer understands.  As a compiler toolchain is a very complex undertaking it is not part of Code::Blocks itself but rather is a separate project that Code::Blocks then uses.  The kind of compiler toolchains talked about in this page are &amp;quot;MinGW&amp;quot; toolchains.  That means &amp;quot;Minimalist GNU for Windows.&amp;quot;  And &amp;quot;GNU&amp;quot; expands to &amp;quot;GNU's Not Unix.&amp;quot;  More information about the GNU project can be found: [https://www.gnu.org/home.en.html here].&lt;br /&gt;
&lt;br /&gt;
For most MinGW-based compiler toolchains, having your toolchain in your PATH is important because it means that during development the toolchain libraries will be accessible by default to your programs as you develop them and also makes it easier to use utilities such as [https://cmake.org/ CMake] as they will be able to find your compiler toolchain.  When you actually distribute your programs to other computers then you will copy the needed .dll files out of your toolchain directory and include them as part of your installer.  On your machine they are in your PATH so you always have them, on your users computers they won't have the compiler toolchain so there you provide the .dll files with your program.&lt;br /&gt;
&lt;br /&gt;
== TDM-GCC ==&lt;br /&gt;
&lt;br /&gt;
[http://tdm-gcc.tdragon.net/ TDM-GCC] is the toolchain that will be used as the example for this guide. The Code::Blocks team recommends TDM builds of MinGW.  TDM-GCC statically links the required toolchain libraries into your final executable.  Which means that when you create your installer for your final program there are less files to include - they are built into your executable itself.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Download the on-demand installer and run it.&lt;br /&gt;
&lt;br /&gt;
Go through the installation pages, the red arrows are all the default options which we will be keeping and the last blue arrow is to indicate that you will be putting TDM-GCC into your system's PATH.  &lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Create.png]] [[Image:TDM_Arch.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Inst_Dir.png]] [[Image:TDM_Inst_Options.png]]&lt;br /&gt;
&lt;br /&gt;
Once you are ready, click Install to proceed.&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Configuration ===&lt;br /&gt;
&lt;br /&gt;
Go to your Compiler settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And then under the &amp;quot;Toolchain executables&amp;quot; tab (red arrow), click on the ellipsis (&amp;quot;...&amp;quot;, blue arrow) and choose the root directory where you installed TDM-GCC 32-bit.  Once you have that directory chosen, in the &amp;quot;Program Files&amp;quot; sub-tab (green arrow) area fill out the fields as shown.  If you aren't using the TDM-GCC toolchain there might be minor variation in the executable names.  If you choose the blue arrow ellipsis ''first'' then for each ellipsis you click on under &amp;quot;Program Files&amp;quot; you will already be in your TDM-GCC &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory where the actual programs are.&lt;br /&gt;
&lt;br /&gt;
[[Image:CB_TDM_Toolchain.png]]&lt;br /&gt;
&lt;br /&gt;
Now, go to your Debugger settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Settings_Debugger.png]]&lt;br /&gt;
&lt;br /&gt;
Choose your default debugger (red arrow), and then fill in the Executable path for it as shown for TDM-GCC 32-bit (blue arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Debugger_Default.png]]&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
You now have a Code::Blocks environment that is configured to use TDM-GCC 32-bit properly.  Using this guide as a template you can easily set up alternative compiler toolchains no matter the source - just follow the same basic procedure.&lt;br /&gt;
&lt;br /&gt;
== Alternative MinGW Compiler Toolchains ==&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org/ MinGW] - The original project.&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/mingw-w64/files/ MinGW-Builds] ➡ In, &amp;quot;Toolchains targeting Win32 or Win64,&amp;quot; ➡ &amp;quot;Personal Builds,&amp;quot; ➡ &amp;quot;mingw-builds,&amp;quot; ➡ Version, ➡ Threading Model, ➡ Exception Model, ➡ Revision.&lt;br /&gt;
&lt;br /&gt;
[http://mingw-w64.org/doku.php Mingw-w64] - The parent project of MinGW-Builds, includes much more than is necessary - MinGW-Builds will usually suffice instead of the full works.&lt;br /&gt;
&lt;br /&gt;
[http://www.equation.com/servlet/equation.cmd?fa=fortran MinGW Equation] - A package that also provides OpenMP.&lt;br /&gt;
&lt;br /&gt;
==Development Tools==&lt;br /&gt;
&lt;br /&gt;
Normally you should not need many of these tools.  ZIP is convenient, especially when: [[Installing_Code::Blocks_from_source_on_Windows | building Code::Blocks itself]], but other than that these tools only serve specialized purposes.&lt;br /&gt;
&lt;br /&gt;
===UnxUtils===&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/unxutils/ UnxUtils]&lt;br /&gt;
&lt;br /&gt;
===GnuWin32===&lt;br /&gt;
&lt;br /&gt;
*[https://sourceforge.net/projects/gnuwin32/ GnuWin32]&lt;br /&gt;
&lt;br /&gt;
===ZIP===&lt;br /&gt;
*[ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn.zip zip-3.0.0 32-bit] or [ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn-x64.zip zip-3.0.0 64-bit]&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9312</id>
		<title>MinGW installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9312"/>
		<updated>2017-07-27T08:21:50Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Documentation]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
A compiler toolchain is what Code::Blocks uses to turn the code you type into it into numbers that the computer understands.  As a compiler toolchain is a very complex undertaking it is not part of Code::Blocks itself but rather is a separate project that Code::Blocks then uses.  The kind of compiler toolchains talked about in this page are &amp;quot;MinGW&amp;quot; toolchains.  That means &amp;quot;Minimalist GNU for Windows.&amp;quot;  And &amp;quot;GNU&amp;quot; expands to &amp;quot;GNU's Not Unix.&amp;quot;  More information about the GNU project can be found: [https://www.gnu.org/home.en.html here].&lt;br /&gt;
&lt;br /&gt;
For most MinGW-based compiler toolchains, having your toolchain in your PATH is important because it means that during development the toolchain libraries will be accessible by default to your programs as you develop them and also makes it easier to use utilities such as [https://cmake.org/ CMake] as they will be able to find your compiler toolchain.  When you actually distribute your programs to other computers then you will copy the needed .dll files out of your toolchain directory and include them as part of your installer.  On your machine they are in your PATH so you always have them, on your users computers they won't have the compiler toolchain so there you provide the .dll files with your program.&lt;br /&gt;
&lt;br /&gt;
== TDM-GCC ==&lt;br /&gt;
&lt;br /&gt;
[http://tdm-gcc.tdragon.net/ TDM-GCC] is the toolchain that will be used as the example for this guide. The Code::Blocks team recommends TDM builds of MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Download the on-demand installer and run it.&lt;br /&gt;
&lt;br /&gt;
Go through the installation pages, the red arrows are all the default options which we will be keeping and the last blue arrow is to indicate that you will be putting TDM-GCC into your system's PATH.  &lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Create.png]] [[Image:TDM_Arch.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Inst_Dir.png]] [[Image:TDM_Inst_Options.png]]&lt;br /&gt;
&lt;br /&gt;
Once you are ready, click Install to proceed.&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Configuration ===&lt;br /&gt;
&lt;br /&gt;
Go to your Compiler settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And then under the &amp;quot;Toolchain executables&amp;quot; tab (red arrow), click on the ellipsis (&amp;quot;...&amp;quot;, blue arrow) and choose the root directory where you installed TDM-GCC 32-bit.  Once you have that directory chosen, in the &amp;quot;Program Files&amp;quot; sub-tab (green arrow) area fill out the fields as shown.  If you aren't using the TDM-GCC toolchain there might be minor variation in the executable names.  If you choose the blue arrow ellipsis ''first'' then for each ellipsis you click on under &amp;quot;Program Files&amp;quot; you will already be in your TDM-GCC &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory where the actual programs are.&lt;br /&gt;
&lt;br /&gt;
[[Image:CB_TDM_Toolchain.png]]&lt;br /&gt;
&lt;br /&gt;
Now, go to your Debugger settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Settings_Debugger.png]]&lt;br /&gt;
&lt;br /&gt;
Choose your default debugger (red arrow), and then fill in the Executable path for it as shown for TDM-GCC 32-bit (blue arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Debugger_Default.png]]&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
You now have a Code::Blocks environment that is configured to use TDM-GCC 32-bit properly.  Using this guide as a template you can easily set up alternative compiler toolchains no matter the source - just follow the same basic procedure.&lt;br /&gt;
&lt;br /&gt;
== Alternative MinGW Compiler Toolchains ==&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org/ MinGW] - The original project.&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/mingw-w64/files/ MinGW-Builds] ➡ In, &amp;quot;Toolchains targeting Win32 or Win64,&amp;quot; ➡ &amp;quot;Personal Builds,&amp;quot; ➡ &amp;quot;mingw-builds,&amp;quot; ➡ Version, ➡ Threading Model, ➡ Exception Model, ➡ Revision.&lt;br /&gt;
&lt;br /&gt;
[http://mingw-w64.org/doku.php Mingw-w64] - The parent project of MinGW-Builds, includes much more than is necessary - MinGW-Builds will usually suffice instead of the full works.&lt;br /&gt;
&lt;br /&gt;
[http://www.equation.com/servlet/equation.cmd?fa=fortran MinGW Equation] - A package that also provides OpenMP.&lt;br /&gt;
&lt;br /&gt;
==Development Tools==&lt;br /&gt;
&lt;br /&gt;
Normally you should not need many of these tools.  ZIP is convenient, especially when: [[Installing_Code::Blocks_from_source_on_Windows | building Code::Blocks itself]], but other than that these tools only serve specialized purposes.&lt;br /&gt;
&lt;br /&gt;
===UnxUtils===&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/unxutils/ UnxUtils]&lt;br /&gt;
&lt;br /&gt;
===GnuWin32===&lt;br /&gt;
&lt;br /&gt;
*[https://sourceforge.net/projects/gnuwin32/ GnuWin32]&lt;br /&gt;
&lt;br /&gt;
===ZIP===&lt;br /&gt;
*[ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn.zip zip-3.0.0 32-bit] or [ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn-x64.zip zip-3.0.0 64-bit]&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9311</id>
		<title>MinGW installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=MinGW_installation&amp;diff=9311"/>
		<updated>2017-07-27T08:19:44Z</updated>

		<summary type="html">&lt;p&gt;Headkase: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:User Documentation]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
A compiler toolchain is what Code::Blocks uses to turn the code you type into it into numbers that the computer understands.  As a compiler toolchain is a very complex undertaking it is not part of Code::Blocks itself but rather is a separate project that Code::Blocks then uses.  The kind of compiler toolchains talked about in this page are &amp;quot;MinGW&amp;quot; toolchains.  That means &amp;quot;Minimalist GNU for Windows.&amp;quot;  And &amp;quot;GNU&amp;quot; expands to &amp;quot;GNU's Not Unix.&amp;quot;  More information about the GNU project can be found: [https://www.gnu.org/home.en.html here].&lt;br /&gt;
&lt;br /&gt;
For most MinGW-based compiler toolchains, having your toolchain in your PATH is important because it means that during development the toolchain libraries will be accessible by default to your programs as you develop them and also makes it easier to use utilities such as [https://cmake.org/ CMake] as they will be able to find your compiler toolchain.  When you actually distribute your programs to other computers then you will copy the needed .dll files out of your toolchain directory and include them as part of your installer.  On your machine they are in your PATH so you always have them, on your users computers they won't have the compiler toolchain so there you provide the .dll files with your program.&lt;br /&gt;
&lt;br /&gt;
TDM-GCC does not strictly follow the preceding however, it tends to statically link the required libraries into your final executable.  Which means that when you create your installer for your final program there are less files to include - they are built into your executable itself.&lt;br /&gt;
&lt;br /&gt;
== TDM-GCC ==&lt;br /&gt;
&lt;br /&gt;
[http://tdm-gcc.tdragon.net/ TDM-GCC] is the toolchain that will be used as the example for this guide. The Code::Blocks team recommends TDM builds of MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
Download the on-demand installer and run it.&lt;br /&gt;
&lt;br /&gt;
Go through the installation pages, the red arrows are all the default options which we will be keeping and the last blue arrow is to indicate that you will be putting TDM-GCC into your system's PATH.  &lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Create.png]] [[Image:TDM_Arch.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:TDM_Inst_Dir.png]] [[Image:TDM_Inst_Options.png]]&lt;br /&gt;
&lt;br /&gt;
Once you are ready, click Install to proceed.&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks Configuration ===&lt;br /&gt;
&lt;br /&gt;
Go to your Compiler settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Compiler_Settings.png]]&lt;br /&gt;
&lt;br /&gt;
And then under the &amp;quot;Toolchain executables&amp;quot; tab (red arrow), click on the ellipsis (&amp;quot;...&amp;quot;, blue arrow) and choose the root directory where you installed TDM-GCC 32-bit.  Once you have that directory chosen, in the &amp;quot;Program Files&amp;quot; sub-tab (green arrow) area fill out the fields as shown.  If you aren't using the TDM-GCC toolchain there might be minor variation in the executable names.  If you choose the blue arrow ellipsis ''first'' then for each ellipsis you click on under &amp;quot;Program Files&amp;quot; you will already be in your TDM-GCC &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; directory where the actual programs are.&lt;br /&gt;
&lt;br /&gt;
[[Image:CB_TDM_Toolchain.png]]&lt;br /&gt;
&lt;br /&gt;
Now, go to your Debugger settings:&lt;br /&gt;
&lt;br /&gt;
[[Image:Settings_Debugger.png]]&lt;br /&gt;
&lt;br /&gt;
Choose your default debugger (red arrow), and then fill in the Executable path for it as shown for TDM-GCC 32-bit (blue arrow).&lt;br /&gt;
&lt;br /&gt;
[[Image:Debugger_Default.png]]&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
You now have a Code::Blocks environment that is configured to use TDM-GCC 32-bit properly.  Using this guide as a template you can easily set up alternative compiler toolchains no matter the source - just follow the same basic procedure.&lt;br /&gt;
&lt;br /&gt;
== Alternative MinGW Compiler Toolchains ==&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org/ MinGW] - The original project.&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/mingw-w64/files/ MinGW-Builds] ➡ In, &amp;quot;Toolchains targeting Win32 or Win64,&amp;quot; ➡ &amp;quot;Personal Builds,&amp;quot; ➡ &amp;quot;mingw-builds,&amp;quot; ➡ Version, ➡ Threading Model, ➡ Exception Model, ➡ Revision.&lt;br /&gt;
&lt;br /&gt;
[http://mingw-w64.org/doku.php Mingw-w64] - The parent project of MinGW-Builds, includes much more than is necessary - MinGW-Builds will usually suffice instead of the full works.&lt;br /&gt;
&lt;br /&gt;
[http://www.equation.com/servlet/equation.cmd?fa=fortran MinGW Equation] - A package that also provides OpenMP.&lt;br /&gt;
&lt;br /&gt;
==Development Tools==&lt;br /&gt;
&lt;br /&gt;
Normally you should not need many of these tools.  ZIP is convenient, especially when: [[Installing_Code::Blocks_from_source_on_Windows | building Code::Blocks itself]], but other than that these tools only serve specialized purposes.&lt;br /&gt;
&lt;br /&gt;
===UnxUtils===&lt;br /&gt;
&lt;br /&gt;
* [https://sourceforge.net/projects/unxutils/ UnxUtils]&lt;br /&gt;
&lt;br /&gt;
===GnuWin32===&lt;br /&gt;
&lt;br /&gt;
*[https://sourceforge.net/projects/gnuwin32/ GnuWin32]&lt;br /&gt;
&lt;br /&gt;
===ZIP===&lt;br /&gt;
*[ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn.zip zip-3.0.0 32-bit] or [ftp://ftp.info-zip.org/pub/infozip/win32/zip300xn-x64.zip zip-3.0.0 64-bit]&lt;/div&gt;</summary>
		<author><name>Headkase</name></author>
	</entry>
</feed>