<?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=Abi79</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=Abi79"/>
	<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php/Special:Contributions/Abi79"/>
	<updated>2026-05-26T12:23:19Z</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_Linux&amp;diff=6598</id>
		<title>Installing Code::Blocks from source on Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux&amp;diff=6598"/>
		<updated>2011-06-18T07:46:51Z</updated>

		<summary type="html">&lt;p&gt;Abi79: /* Getting 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;
These are instructions on how to build Code::Blocks under Linux. These instructions should work for all Linux distros, as we'll be installing from sources.&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
In order to successfully compile Code::Blocks, the [http://en.wikipedia.org/wiki/WxWidgets wxWidgets] User Interface library &amp;lt;u&amp;gt;must be installed&amp;lt;/u&amp;gt;. For most Linux users, this is maybe the only dependency not already installed. wxWidget can be used directly on top of the X server, in this case the variant of the wxWidget library is called wxX11. However this library [http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits#Why_You_Shouldn.27t_Use_wxWidgets is sub-par compared to other toolkits and unstable]. Hence Code::Blocks uses wxGTK, the version of wxWidget based on GTK+. The exact requirement is libwxGTK-2.8.0 or later (2.8.3 is not recommended because of some troubles). This creates an additional dependency on GTK+, consider the following:&lt;br /&gt;
&lt;br /&gt;
A possible implementation which does not exist: &lt;br /&gt;
&lt;br /&gt;
''Code::Blocks  -&amp;gt;  xwWidget (libwxX11)  -&amp;gt;  X''&lt;br /&gt;
&lt;br /&gt;
Current Code::Blocks implementation: &lt;br /&gt;
&lt;br /&gt;
''Code::Blocks  -&amp;gt;  '''xwWidget (&amp;gt; libwxGTK2.8)'''  -&amp;gt;  '''GTK+ (&amp;gt; libgtk-x11-2.0)'''  -&amp;gt;  X''&lt;br /&gt;
&lt;br /&gt;
This document helps you to install libwxGTK if necessary but does not cover the installation of GTK+. GTK+ is probably installed on your Linux anyway, so don't worry ;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Note:'' All the instructions below, assume an existing directory named &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;. If you 'll be using a different one, adjust the path to match.&lt;br /&gt;
As a first step create this directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking the presence of GTK+ library ===&lt;br /&gt;
&lt;br /&gt;
Have a look in /usr/lib for something like &amp;quot;libgtk-x11-2.0.so&amp;quot; (Note the library must be 2.0 minimum). Alternatively, do a search with your package manager or go to your Linux distribution forum for help. If you don't want to loose time, you can even forget this check since there is a good probability that everything is already installed.&lt;br /&gt;
&lt;br /&gt;
===Library wxGTK installation===&lt;br /&gt;
&lt;br /&gt;
==== Checking the presence of libwxGTK library ====&lt;br /&gt;
&lt;br /&gt;
In your package manager, look for 'libwxgtk' keyword and verify that '''all''' libwxgtk2.8 stuffs are installed. If you find the libraries uninstalled, just '''install them and go directly to [https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux#Code::Blocks_installation Code::Blocks installation]'''.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do the same in the command line (the following is an example, there may be more than two packages):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ls /usr/lib/libwx_gtk* //to verify the presence&lt;br /&gt;
$ sudo apt-get install libwxgtk2.8-dev&lt;br /&gt;
$ sudo apt-get install libwxgtk2.8-0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don't find any packages you must install the library from source as described below, and you can redo this check afterwards to verify that the installation worked correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Note for Debian and Ubuntu users:'' You can use &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ update-alternatives --config wx-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to see which version of libwx is there or not and currently active.&lt;br /&gt;
&lt;br /&gt;
====Getting wxGTK sources====&lt;br /&gt;
&lt;br /&gt;
Visit the [http://www.wxwidgets.org wxWidgets web site]. Click the &amp;quot;Download&amp;quot; button at the top of the page. Under wxWidgets 2.8.7 downloads, select wxGTK. Save the file in &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;. After the download finishes, switch to &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, untar the wxGTK sources:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar zxf wxGTK-2.8.7.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Switch to the wxGTK directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd wxGTK-2.8.7&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Building wxWidgets====&lt;br /&gt;
&lt;br /&gt;
Here we will create a separate build directory instead of building from the src directory, so that we can easily rebuild with different options (unicode / ansi, monolithic / many libs, etc).&lt;br /&gt;
&lt;br /&gt;
The documentation says the default is for gtk2 to use unicode and wx &amp;gt; 2.5 to build as a monolithic library.  This doesn't appear to be the case, so these flags are passed to configure:&lt;br /&gt;
&lt;br /&gt;
 mkdir build_gtk2_shared_monolithic_unicode&lt;br /&gt;
 cd build_gtk2_shared_monolithic_unicode&lt;br /&gt;
 ../configure --prefix=/opt/wx/2.8 \&lt;br /&gt;
        --enable-xrc \&lt;br /&gt;
        --enable-monolithic \&lt;br /&gt;
        --enable-unicode&lt;br /&gt;
 make&lt;br /&gt;
 su&lt;br /&gt;
 make install&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
Add /opt/wx/2.8/bin to the PATH (if your shell is bash then edit /etc/profile or ~/.bash_profile)&lt;br /&gt;
(On ''Suse 10.1'' edit /etc/profile.local, it will only be available after a new login). An example PATH:&lt;br /&gt;
 export PATH=/usr/bin:/opt/wx/2.8/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
Add /opt/wx/2.8/lib to /etc/ld.so.conf (nano /etc/ld.so.conf), then run:&lt;br /&gt;
 ldconfig&lt;br /&gt;
 source /etc/profile&lt;br /&gt;
&lt;br /&gt;
That's it.  Now the linker will look in /opt/wx/2.8/lib for wx libraries and you will have a monolithic shared library unicode build.&lt;br /&gt;
&lt;br /&gt;
To check that things are working, type:&lt;br /&gt;
 wx-config --prefix&lt;br /&gt;
which should give you /opt/wx/2.8&lt;br /&gt;
 wx-config --libs&lt;br /&gt;
which should have at least:&lt;br /&gt;
 -L/opt/wx/2.8/lib -lwx_gtk2-2.8&lt;br /&gt;
but can contain other flags as well.&lt;br /&gt;
 which wx-config&lt;br /&gt;
should return /opt/wx/2.8/bin/wx-config&lt;br /&gt;
&lt;br /&gt;
===Code::Blocks installation===&lt;br /&gt;
&lt;br /&gt;
====Getting Code::Blocks sources====&lt;br /&gt;
&lt;br /&gt;
You can get Code::Blocks source code [https://www.codeblocks.org/downloads/25 from the website as a tarball] or from the [https://www.codeblocks.org/downloads/7 SVN repository] (this second method is described below).&lt;br /&gt;
&lt;br /&gt;
=====From SVN repository=====&lt;br /&gt;
NOTICE: The SourceForge CVS is no longer used although it still exists.&lt;br /&gt;
&lt;br /&gt;
Enter your development directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then checkout the source using one of [https://www.codeblocks.org/downloads/7 these] methods. This will create the directory &amp;lt;tt&amp;gt;trunk&amp;lt;/tt&amp;gt;. Change to the source code directory, by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd trunk&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are a ''Gentoo'' user at this point, please see [[Compiling_Code::Blocks_in_Gentoo]].&lt;br /&gt;
&lt;br /&gt;
Before beginning, it is often a good idea to check you have recent versions of autoconf and automake - repositories versions are not always recent enough. (if you do not have automake, then you will get &amp;quot;cannot find aclocal&amp;quot; error). If you're compiling the svn trunk versions of CodeBlocks (or future versions) then the unix build has switched to autotools.  So first build wxWidgets as described above and then build CodeBlocks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ./bootstrap&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up the configure script and its dependencies.  It only needs to be run once (after downloading the source from svn).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''If you get errors like:'''&lt;br /&gt;
 aclocal:configure.in:61: warning: macro `AM_OPTIONS_WXCONFIG' not found in library&lt;br /&gt;
Then aclocal is having trouble finding the wxWidgets .m4 files.  You can do one of two things:&lt;br /&gt;
To just get bootstrap to find the path this time do:&lt;br /&gt;
&amp;lt;!-- *********** Bad syntax... removed 2006-08-28 by BentFX ****************************&lt;br /&gt;
 export ACLOCAL_FLAGS=&amp;quot;--acdir=`wx-config --prefix`/share/aclocal&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: Note: The above command resulted in missing macros when running ./bootstrap for me. Setting an additional search path instead of overwriting like above worked for me. In case of missing macros try &lt;br /&gt;
***********************************************************************************--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;export ACLOCAL_FLAGS=&amp;quot;-I `wx-config --prefix`/share/aclocal&amp;quot;&amp;lt;/pre&amp;gt; &amp;lt;!--[[User:Jabber|Jabber]] 06:24, 2 August 2006 (EDT)--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change the aclocal search path more permanently do:&lt;br /&gt;
 echo `wx-config --prefix`/share/aclocal &amp;gt;&amp;gt; /usr/share/aclocal/dirlist&lt;br /&gt;
Then aclocal will also search somewhere like /opt/wx/2.6/share/aclocal&lt;br /&gt;
&lt;br /&gt;
'''''Note for Ubuntu users:''''' The above is not the correct way to fix the AM_* errors. Rather, you only need to install the package named &amp;quot;wx-common&amp;quot; (Universe repository).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you get something like&lt;br /&gt;
 The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'&lt;br /&gt;
&lt;br /&gt;
it can be solved by something like: (adapt path, use `wx-config --prefix` is necessary)&lt;br /&gt;
&lt;br /&gt;
 ACLOCAL_FLAGS=&amp;quot;-I /usr/share/aclocal&amp;quot; ./bootstrap&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''If you run ./bootstrap and get errors like''':&lt;br /&gt;
 bad interpreter: File not found&lt;br /&gt;
then there exists a problem with DOS line-endings. I had this error after I tried to build CodeBlocks from sources which were checked out with CVS on a Windows machine. After I checked out a fresh copy of CodeBlocks from CVS under Ubuntu Linux, all errors were gone. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Or, instead of downloading from SVN, you might consider using the little command line tool [http://dos2unix.sourceforge.net/ dos2unix], which normally comes with most distributions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If configure aborts with some unspecific error message(&amp;quot;.infig.status: error: cannot find input file: Makefile&amp;quot;), you might consider also running dos2unix bootstrap acinclude.m4 codeblocks.pc.in configure.in Makefile.am before running bootstrap. Once you've run the bootstrap script, jump to next step.&lt;br /&gt;
&lt;br /&gt;
====Installing Code::Blocks sources====&lt;br /&gt;
You can read the BUILD file included in the source, but everything is very straightforward. Do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure&lt;br /&gt;
 make&lt;br /&gt;
 make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have multiple versions of wxWidgets installed or kept them in place, you can use:&lt;br /&gt;
 ./configure --with-wx-config=/path/to/wx-config&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The Nassi Shneiderman plugin (part of the contrib plugins) has a dependency on [http://www.boost.org boost] which is needed to compile this plugin. Boost does not need to be compiled therefore. It is not checked for the existing of boost at the moment (except for debian build-system, there it is a build-dependency), so if you configure C::B to be build without Nassi Schneiderman, it should not lead to problems in case you don't have/want boost.&lt;br /&gt;
&lt;br /&gt;
To uninstall you can later run:&lt;br /&gt;
 make uninstall&lt;br /&gt;
&lt;br /&gt;
If you want to recompile everything, first run:&lt;br /&gt;
&amp;lt;pre&amp;gt; make clean&lt;br /&gt;
 make distclean&lt;br /&gt;
 make clean-bin&lt;br /&gt;
 make clean-zipfiles&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then follow the above sequence for installing.&lt;br /&gt;
&lt;br /&gt;
By default, CodeBlocks will install to /usr/local.  If you want it in its own tree (so you can have multiple versions of CodeBlocks, each in its own subdirectory of /opt) replace the above ./configure command with:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --prefix=/opt/codeblocks-svn&amp;lt;/pre&amp;gt;&lt;br /&gt;
or similar.  Then you can later install a different build like:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --prefix=/opt/codeblocks2-svn&amp;lt;/pre&amp;gt;&lt;br /&gt;
followed by 'make &amp;amp;&amp;amp; make install' as usual.&lt;br /&gt;
&lt;br /&gt;
By default, CodeBlocks will not compile the contributed plugins from SVN.  If you want to compile / install them too, replace the above ./configure command with:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --with-contrib-plugins=all&amp;lt;/pre&amp;gt;&lt;br /&gt;
followed by 'make &amp;amp;&amp;amp; make install' as usual.&lt;br /&gt;
&lt;br /&gt;
To see a list of other options available for configuring the build of CodeBlocks do:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile under ''Gentoo'', use:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --with-wx-config=wx-config-2.8&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Resolving issues====&lt;br /&gt;
&lt;br /&gt;
When running Code::Blocks after the installation it might happen, that the system complains:&lt;br /&gt;
 codeblocks: error while loading shared libraries: libcodeblocks.so.0: cannot open shared object file: No such file or directory&lt;br /&gt;
In that case make sure the library path where the Code::Blocks libraries where installed into is &amp;quot;known&amp;quot; to the system. For example: On Ubuntu using a default build process on a clean system will install the Code::Blocks executables to /use/local/bin and the libraries to /usr/local/lib. The latter is usually not known to a &amp;quot;clean&amp;quot; Ubuntu system. To add it to the search path for libraries do the following (as root / using sudo respectively):&lt;br /&gt;
Add the following line to the file /etc/ld.so.conf:&lt;br /&gt;
 /usr/local/lib&lt;br /&gt;
...and run:&lt;br /&gt;
 ldconfig&lt;br /&gt;
That's it - Code::Blocks should now work just fine as all libraries are being found.&lt;/div&gt;</summary>
		<author><name>Abi79</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux&amp;diff=6597</id>
		<title>Installing Code::Blocks from source on Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux&amp;diff=6597"/>
		<updated>2011-06-18T07:18:13Z</updated>

		<summary type="html">&lt;p&gt;Abi79: /* wxWidgets build */&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;
These are instructions on how to build Code::Blocks under Linux. These instructions should work for all Linux distros, as we'll be installing from sources.&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
In order to successfully compile Code::Blocks, the [http://en.wikipedia.org/wiki/WxWidgets wxWidgets] User Interface library &amp;lt;u&amp;gt;must be installed&amp;lt;/u&amp;gt;. For most Linux users, this is maybe the only dependency not already installed. wxWidget can be used directly on top of the X server, in this case the variant of the wxWidget library is called wxX11. However this library [http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits#Why_You_Shouldn.27t_Use_wxWidgets is sub-par compared to other toolkits and unstable]. Hence Code::Blocks uses wxGTK, the version of wxWidget based on GTK+. The exact requirement is libwxGTK-2.8.0 or later (2.8.3 is not recommended because of some troubles). This creates an additional dependency on GTK+, consider the following:&lt;br /&gt;
&lt;br /&gt;
A possible implementation which does not exist: &lt;br /&gt;
&lt;br /&gt;
''Code::Blocks  -&amp;gt;  xwWidget (libwxX11)  -&amp;gt;  X''&lt;br /&gt;
&lt;br /&gt;
Current Code::Blocks implementation: &lt;br /&gt;
&lt;br /&gt;
''Code::Blocks  -&amp;gt;  '''xwWidget (&amp;gt; libwxGTK2.8)'''  -&amp;gt;  '''GTK+ (&amp;gt; libgtk-x11-2.0)'''  -&amp;gt;  X''&lt;br /&gt;
&lt;br /&gt;
This document helps you to install libwxGTK if necessary but does not cover the installation of GTK+. GTK+ is probably installed on your Linux anyway, so don't worry ;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Note:'' All the instructions below, assume an existing directory named &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;. If you 'll be using a different one, adjust the path to match.&lt;br /&gt;
As a first step create this directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking the presence of GTK+ library ===&lt;br /&gt;
&lt;br /&gt;
Have a look in /usr/lib for something like &amp;quot;libgtk-x11-2.0.so&amp;quot; (Note the library must be 2.0 minimum). Alternatively, do a search with your package manager or go to your Linux distribution forum for help. If you don't want to loose time, you can even forget this check since there is a good probability that everything is already installed.&lt;br /&gt;
&lt;br /&gt;
===Library wxGTK installation===&lt;br /&gt;
&lt;br /&gt;
==== Checking the presence of libwxGTK library ====&lt;br /&gt;
&lt;br /&gt;
In your package manager, look for 'libwxgtk' keyword and verify that '''all''' libwxgtk2.8 stuffs are installed. If you find the libraries uninstalled, just '''install them and go directly to [https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux#Code::Blocks_installation Code::Blocks installation]'''.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do the same in the command line (the following is an example, there may be more than two packages):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ls /usr/lib/libwx_gtk* //to verify the presence&lt;br /&gt;
$ sudo apt-get install libwxgtk2.8-dev&lt;br /&gt;
$ sudo apt-get install libwxgtk2.8-0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don't find any packages you must install the library from source as described below, and you can redo this check afterwards to verify that the installation worked correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Note for Debian and Ubuntu users:'' You can use &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ update-alternatives --config wx-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to see which version of libwx is there or not and currently active.&lt;br /&gt;
&lt;br /&gt;
====Getting wxGTK sources====&lt;br /&gt;
&lt;br /&gt;
Visit the [http://www.wxwidgets.org wxWidgets web site]. Click the &amp;quot;Download&amp;quot; button at the top of the page. Under wxWidgets 2.8.7 downloads, select wxGTK. Save the file in &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;. After the download finishes, switch to &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, untar the wxGTK sources:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar zxf wxGTK-2.8.7.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Switch to the wxGTK directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd wxGTK-2.8.7&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Building wxWidgets====&lt;br /&gt;
&lt;br /&gt;
Here we will create a separate build directory instead of building from the src directory, so that we can easily rebuild with different options (unicode / ansi, monolithic / many libs, etc).&lt;br /&gt;
&lt;br /&gt;
The documentation says the default is for gtk2 to use unicode and wx &amp;gt; 2.5 to build as a monolithic library.  This doesn't appear to be the case, so these flags are passed to configure:&lt;br /&gt;
&lt;br /&gt;
 mkdir build_gtk2_shared_monolithic_unicode&lt;br /&gt;
 cd build_gtk2_shared_monolithic_unicode&lt;br /&gt;
 ../configure --prefix=/opt/wx/2.8 \&lt;br /&gt;
        --enable-xrc \&lt;br /&gt;
        --enable-monolithic \&lt;br /&gt;
        --enable-unicode&lt;br /&gt;
 make&lt;br /&gt;
 su&lt;br /&gt;
 make install&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
Add /opt/wx/2.8/bin to the PATH (if your shell is bash then edit /etc/profile or ~/.bash_profile)&lt;br /&gt;
(On ''Suse 10.1'' edit /etc/profile.local, it will only be available after a new login). An example PATH:&lt;br /&gt;
 export PATH=/usr/bin:/opt/wx/2.8/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
Add /opt/wx/2.8/lib to /etc/ld.so.conf (nano /etc/ld.so.conf), then run:&lt;br /&gt;
 ldconfig&lt;br /&gt;
 source /etc/profile&lt;br /&gt;
&lt;br /&gt;
That's it.  Now the linker will look in /opt/wx/2.8/lib for wx libraries and you will have a monolithic shared library unicode build.&lt;br /&gt;
&lt;br /&gt;
To check that things are working, type:&lt;br /&gt;
 wx-config --prefix&lt;br /&gt;
which should give you /opt/wx/2.8&lt;br /&gt;
 wx-config --libs&lt;br /&gt;
which should have at least:&lt;br /&gt;
 -L/opt/wx/2.8/lib -lwx_gtk2-2.8&lt;br /&gt;
but can contain other flags as well.&lt;br /&gt;
 which wx-config&lt;br /&gt;
should return /opt/wx/2.8/bin/wx-config&lt;br /&gt;
&lt;br /&gt;
===Code::Blocks installation===&lt;br /&gt;
&lt;br /&gt;
====Getting Code::Blocks sources====&lt;br /&gt;
&lt;br /&gt;
You can get Code::Blocks source code [https://www.codeblocks.org/downloads/6 from the website as a tarball] or from the SVN repository (this second method is described below).&lt;br /&gt;
&lt;br /&gt;
=====From SVN repository=====&lt;br /&gt;
NOTICE: The SourceForge CVS is no longer used although it still exists.&lt;br /&gt;
&lt;br /&gt;
Enter your development directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then checkout the source using one of [https://www.codeblocks.org/downloads/7 these] methods. This will create the directory &amp;lt;tt&amp;gt;trunk&amp;lt;/tt&amp;gt;. Change to the source code directory, by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd trunk&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are a ''Gentoo'' user at this point, please see [[Compiling_Code::Blocks_in_Gentoo]].&lt;br /&gt;
&lt;br /&gt;
Before beginning, it is often a good idea to check you have recent versions of autoconf and automake - repositories versions are not always recent enough. (if you do not have automake, then you will get &amp;quot;cannot find aclocal&amp;quot; error). If you're compiling the svn trunk versions of CodeBlocks (or future versions) then the unix build has switched to autotools.  So first build wxWidgets as described above and then build CodeBlocks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ./bootstrap&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up the configure script and its dependencies.  It only needs to be run once (after downloading the source from svn).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''If you get errors like:'''&lt;br /&gt;
 aclocal:configure.in:61: warning: macro `AM_OPTIONS_WXCONFIG' not found in library&lt;br /&gt;
Then aclocal is having trouble finding the wxWidgets .m4 files.  You can do one of two things:&lt;br /&gt;
To just get bootstrap to find the path this time do:&lt;br /&gt;
&amp;lt;!-- *********** Bad syntax... removed 2006-08-28 by BentFX ****************************&lt;br /&gt;
 export ACLOCAL_FLAGS=&amp;quot;--acdir=`wx-config --prefix`/share/aclocal&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: Note: The above command resulted in missing macros when running ./bootstrap for me. Setting an additional search path instead of overwriting like above worked for me. In case of missing macros try &lt;br /&gt;
***********************************************************************************--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;export ACLOCAL_FLAGS=&amp;quot;-I `wx-config --prefix`/share/aclocal&amp;quot;&amp;lt;/pre&amp;gt; &amp;lt;!--[[User:Jabber|Jabber]] 06:24, 2 August 2006 (EDT)--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change the aclocal search path more permanently do:&lt;br /&gt;
 echo `wx-config --prefix`/share/aclocal &amp;gt;&amp;gt; /usr/share/aclocal/dirlist&lt;br /&gt;
Then aclocal will also search somewhere like /opt/wx/2.6/share/aclocal&lt;br /&gt;
&lt;br /&gt;
'''''Note for Ubuntu users:''''' The above is not the correct way to fix the AM_* errors. Rather, you only need to install the package named &amp;quot;wx-common&amp;quot; (Universe repository).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you get something like&lt;br /&gt;
 The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'&lt;br /&gt;
&lt;br /&gt;
it can be solved by something like: (adapt path, use `wx-config --prefix` is necessary)&lt;br /&gt;
&lt;br /&gt;
 ACLOCAL_FLAGS=&amp;quot;-I /usr/share/aclocal&amp;quot; ./bootstrap&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''If you run ./bootstrap and get errors like''':&lt;br /&gt;
 bad interpreter: File not found&lt;br /&gt;
then there exists a problem with DOS line-endings. I had this error after I tried to build CodeBlocks from sources which were checked out with CVS on a Windows machine. After I checked out a fresh copy of CodeBlocks from CVS under Ubuntu Linux, all errors were gone. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Or, instead of downloading from SVN, you might consider using the little command line tool [http://dos2unix.sourceforge.net/ dos2unix], which normally comes with most distributions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If configure aborts with some unspecific error message(&amp;quot;.infig.status: error: cannot find input file: Makefile&amp;quot;), you might consider also running dos2unix bootstrap acinclude.m4 codeblocks.pc.in configure.in Makefile.am before running bootstrap. Once you've run the bootstrap script, jump to next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installing Code::Blocks sources====&lt;br /&gt;
You can read the BUILD file included in the source, but everything is very straightforward. Do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure&lt;br /&gt;
 make&lt;br /&gt;
 make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have multiple versions of wxWidgets installed or kept them in place, you can use:&lt;br /&gt;
 ./configure --with-wx-config=/path/to/wx-config&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The Nassi Shneiderman plugin (part of the contrib plugins) has a dependency on [http://www.boost.org boost] which is needed to compile this plugin. Boost does not need to be compiled therefore. It is not checked for the existing of boost at the moment (except for debian build-system, there it is a build-dependency), so if you configure C::B to be build without Nassi Schneiderman, it should not lead to problems in case you don't have/want boost.&lt;br /&gt;
&lt;br /&gt;
To uninstall you can later run:&lt;br /&gt;
 make uninstall&lt;br /&gt;
&lt;br /&gt;
If you want to recompile everything, first run:&lt;br /&gt;
&amp;lt;pre&amp;gt; make clean&lt;br /&gt;
 make distclean&lt;br /&gt;
 make clean-bin&lt;br /&gt;
 make clean-zipfiles&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then follow the above sequence for installing.&lt;br /&gt;
&lt;br /&gt;
By default, CodeBlocks will install to /usr/local.  If you want it in its own tree (so you can have multiple versions of CodeBlocks, each in its own subdirectory of /opt) replace the above ./configure command with:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --prefix=/opt/codeblocks-svn&amp;lt;/pre&amp;gt;&lt;br /&gt;
or similar.  Then you can later install a different build like:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --prefix=/opt/codeblocks2-svn&amp;lt;/pre&amp;gt;&lt;br /&gt;
followed by 'make &amp;amp;&amp;amp; make install' as usual.&lt;br /&gt;
&lt;br /&gt;
By default, CodeBlocks will not compile the contributed plugins from SVN.  If you want to compile / install them too, replace the above ./configure command with:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --with-contrib-plugins=all&amp;lt;/pre&amp;gt;&lt;br /&gt;
followed by 'make &amp;amp;&amp;amp; make install' as usual.&lt;br /&gt;
&lt;br /&gt;
To see a list of other options available for configuring the build of CodeBlocks do:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile under ''Gentoo'', use:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --with-wx-config=wx-config-2.8&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Resolving issues====&lt;br /&gt;
&lt;br /&gt;
When running Code::Blocks after the installation it might happen, that the system complains:&lt;br /&gt;
 codeblocks: error while loading shared libraries: libcodeblocks.so.0: cannot open shared object file: No such file or directory&lt;br /&gt;
In that case make sure the library path where the Code::Blocks libraries where installed into is &amp;quot;known&amp;quot; to the system. For example: On Ubuntu using a default build process on a clean system will install the Code::Blocks executables to /use/local/bin and the libraries to /usr/local/lib. The latter is usually not known to a &amp;quot;clean&amp;quot; Ubuntu system. To add it to the search path for libraries do the following (as root / using sudo respectively):&lt;br /&gt;
Add the following line to the file /etc/ld.so.conf:&lt;br /&gt;
 /usr/local/lib&lt;br /&gt;
...and run:&lt;br /&gt;
 ldconfig&lt;br /&gt;
That's it - Code::Blocks should now work just fine as all libraries are being found.&lt;/div&gt;</summary>
		<author><name>Abi79</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux&amp;diff=6596</id>
		<title>Installing Code::Blocks from source on Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux&amp;diff=6596"/>
		<updated>2011-06-18T06:49:11Z</updated>

		<summary type="html">&lt;p&gt;Abi79: &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;
These are instructions on how to build Code::Blocks under Linux. These instructions should work for all Linux distros, as we'll be installing from sources.&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
In order to successfully compile Code::Blocks, the [http://en.wikipedia.org/wiki/WxWidgets wxWidgets] User Interface library &amp;lt;u&amp;gt;must be installed&amp;lt;/u&amp;gt;. For most Linux users, this is maybe the only dependency not already installed. wxWidget can be used directly on top of the X server, in this case the variant of the wxWidget library is called wxX11. However this library [http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits#Why_You_Shouldn.27t_Use_wxWidgets is sub-par compared to other toolkits and unstable]. Hence Code::Blocks uses wxGTK, the version of wxWidget based on GTK+. The exact requirement is libwxGTK-2.8.0 or later (2.8.3 is not recommended because of some troubles). This creates an additional dependency on GTK+, consider the following:&lt;br /&gt;
&lt;br /&gt;
A possible implementation which does not exist: &lt;br /&gt;
&lt;br /&gt;
''Code::Blocks  -&amp;gt;  xwWidget (libwxX11)  -&amp;gt;  X''&lt;br /&gt;
&lt;br /&gt;
Current Code::Blocks implementation: &lt;br /&gt;
&lt;br /&gt;
''Code::Blocks  -&amp;gt;  '''xwWidget (&amp;gt; libwxGTK2.8)'''  -&amp;gt;  '''GTK+ (&amp;gt; libgtk-x11-2.0)'''  -&amp;gt;  X''&lt;br /&gt;
&lt;br /&gt;
This document helps you to install libwxGTK if necessary but does not cover the installation of GTK+. GTK+ is probably installed on your Linux anyway, so don't worry ;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Note:'' All the instructions below, assume an existing directory named &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;. If you 'll be using a different one, adjust the path to match.&lt;br /&gt;
As a first step create this directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking the presence of GTK+ library ===&lt;br /&gt;
&lt;br /&gt;
Have a look in /usr/lib for something like &amp;quot;libgtk-x11-2.0.so&amp;quot; (Note the library must be 2.0 minimum). Alternatively, do a search with your package manager or go to your Linux distribution forum for help. If you don't want to loose time, you can even forget this check since there is a good probability that everything is already installed.&lt;br /&gt;
&lt;br /&gt;
===Library wxGTK installation===&lt;br /&gt;
&lt;br /&gt;
==== Checking the presence of libwxGTK library ====&lt;br /&gt;
&lt;br /&gt;
In your package manager, look for 'libwxgtk' keyword and verify that '''all''' libwxgtk2.8 stuffs are installed. If you find the libraries uninstalled, just '''install them and go directly to [https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux#Code::Blocks_installation Code::Blocks installation]'''.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do the same in the command line (the following is an example, there may be more than two packages):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ls /usr/lib/libwx_gtk* //to verify the presence&lt;br /&gt;
$ sudo apt-get install libwxgtk2.8-dev&lt;br /&gt;
$ sudo apt-get install libwxgtk2.8-0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don't find any packages you must install the library from source as described below, and you can redo this check afterwards to verify that the installation worked correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Note for Debian and Ubuntu users:'' You can use &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ update-alternatives --config wx-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to see which version of libwx is there or not and currently active.&lt;br /&gt;
&lt;br /&gt;
====Getting wxGTK sources====&lt;br /&gt;
&lt;br /&gt;
Visit the [http://www.wxwidgets.org wxWidgets web site]. Click the &amp;quot;Download&amp;quot; button at the top of the page. Under wxWidgets 2.8.7 downloads, select wxGTK. Save the file in &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;. After the download finishes, switch to &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, untar the wxGTK sources:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar zxf wxGTK-2.8.7.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Switch to the wxGTK directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd wxGTK-2.8.7&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wxWidgets build====&lt;br /&gt;
&lt;br /&gt;
Here we will create a separate build directory instead of building from the src directory, so that we can easily rebuild with different options (unicode / ansi, monolithic / many libs, etc).&lt;br /&gt;
&lt;br /&gt;
The documentation says the default is for gtk2 to use unicode and wx &amp;gt; 2.5 to build as a monolithic library.  This doesn't appear to be the case, so these flags are passed to configure:&lt;br /&gt;
&lt;br /&gt;
 mkdir build_gtk2_shared_monolithic_unicode&lt;br /&gt;
 cd build_gtk2_shared_monolithic_unicode&lt;br /&gt;
 ../configure --prefix=/opt/wx/2.8 \&lt;br /&gt;
        --enable-xrc \&lt;br /&gt;
        --enable-monolithic \&lt;br /&gt;
        --enable-unicode&lt;br /&gt;
 make&lt;br /&gt;
 su&lt;br /&gt;
 make install&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
Add /opt/wx/2.8/bin to the PATH (if your shell is bash then edit /etc/profile or ~/.bash_profile)&lt;br /&gt;
(On ''Suse 10.1'' edit /etc/profile.local, it will only be available after a new login). An example PATH:&lt;br /&gt;
 export PATH=/usr/bin:/opt/wx/2.8/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
Add /opt/wx/2.8/lib to /etc/ld.so.conf (nano /etc/ld.so.conf), then run:&lt;br /&gt;
 ldconfig&lt;br /&gt;
 source /etc/profile&lt;br /&gt;
&lt;br /&gt;
That's it.  Now the linker will look in /opt/wx/2.8/lib for wx libraries and you will have a monolithic shared library unicode build.&lt;br /&gt;
&lt;br /&gt;
To check that things are working, type:&lt;br /&gt;
 wx-config --prefix&lt;br /&gt;
which should give you /opt/wx/2.8&lt;br /&gt;
 wx-config --libs&lt;br /&gt;
which should have at least:&lt;br /&gt;
 -L/opt/wx/2.8/lib -lwx_gtk2-2.8&lt;br /&gt;
but can contain other flags as well.&lt;br /&gt;
 which wx-config&lt;br /&gt;
should return /opt/wx/2.8/bin/wx-config&lt;br /&gt;
&lt;br /&gt;
===Code::Blocks installation===&lt;br /&gt;
&lt;br /&gt;
====Getting Code::Blocks sources====&lt;br /&gt;
&lt;br /&gt;
You can get Code::Blocks source code [https://www.codeblocks.org/downloads/6 from the website as a tarball] or from the SVN repository (this second method is described below).&lt;br /&gt;
&lt;br /&gt;
=====From SVN repository=====&lt;br /&gt;
NOTICE: The SourceForge CVS is no longer used although it still exists.&lt;br /&gt;
&lt;br /&gt;
Enter your development directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then checkout the source using one of [https://www.codeblocks.org/downloads/7 these] methods. This will create the directory &amp;lt;tt&amp;gt;trunk&amp;lt;/tt&amp;gt;. Change to the source code directory, by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd trunk&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are a ''Gentoo'' user at this point, please see [[Compiling_Code::Blocks_in_Gentoo]].&lt;br /&gt;
&lt;br /&gt;
Before beginning, it is often a good idea to check you have recent versions of autoconf and automake - repositories versions are not always recent enough. (if you do not have automake, then you will get &amp;quot;cannot find aclocal&amp;quot; error). If you're compiling the svn trunk versions of CodeBlocks (or future versions) then the unix build has switched to autotools.  So first build wxWidgets as described above and then build CodeBlocks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ./bootstrap&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up the configure script and its dependencies.  It only needs to be run once (after downloading the source from svn).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''If you get errors like:'''&lt;br /&gt;
 aclocal:configure.in:61: warning: macro `AM_OPTIONS_WXCONFIG' not found in library&lt;br /&gt;
Then aclocal is having trouble finding the wxWidgets .m4 files.  You can do one of two things:&lt;br /&gt;
To just get bootstrap to find the path this time do:&lt;br /&gt;
&amp;lt;!-- *********** Bad syntax... removed 2006-08-28 by BentFX ****************************&lt;br /&gt;
 export ACLOCAL_FLAGS=&amp;quot;--acdir=`wx-config --prefix`/share/aclocal&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: Note: The above command resulted in missing macros when running ./bootstrap for me. Setting an additional search path instead of overwriting like above worked for me. In case of missing macros try &lt;br /&gt;
***********************************************************************************--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;export ACLOCAL_FLAGS=&amp;quot;-I `wx-config --prefix`/share/aclocal&amp;quot;&amp;lt;/pre&amp;gt; &amp;lt;!--[[User:Jabber|Jabber]] 06:24, 2 August 2006 (EDT)--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change the aclocal search path more permanently do:&lt;br /&gt;
 echo `wx-config --prefix`/share/aclocal &amp;gt;&amp;gt; /usr/share/aclocal/dirlist&lt;br /&gt;
Then aclocal will also search somewhere like /opt/wx/2.6/share/aclocal&lt;br /&gt;
&lt;br /&gt;
'''''Note for Ubuntu users:''''' The above is not the correct way to fix the AM_* errors. Rather, you only need to install the package named &amp;quot;wx-common&amp;quot; (Universe repository).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you get something like&lt;br /&gt;
 The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'&lt;br /&gt;
&lt;br /&gt;
it can be solved by something like: (adapt path, use `wx-config --prefix` is necessary)&lt;br /&gt;
&lt;br /&gt;
 ACLOCAL_FLAGS=&amp;quot;-I /usr/share/aclocal&amp;quot; ./bootstrap&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''If you run ./bootstrap and get errors like''':&lt;br /&gt;
 bad interpreter: File not found&lt;br /&gt;
then there exists a problem with DOS line-endings. I had this error after I tried to build CodeBlocks from sources which were checked out with CVS on a Windows machine. After I checked out a fresh copy of CodeBlocks from CVS under Ubuntu Linux, all errors were gone. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Or, instead of downloading from SVN, you might consider using the little command line tool [http://dos2unix.sourceforge.net/ dos2unix], which normally comes with most distributions.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If configure aborts with some unspecific error message(&amp;quot;.infig.status: error: cannot find input file: Makefile&amp;quot;), you might consider also running dos2unix bootstrap acinclude.m4 codeblocks.pc.in configure.in Makefile.am before running bootstrap. Once you've run the bootstrap script, jump to next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installing Code::Blocks sources====&lt;br /&gt;
You can read the BUILD file included in the source, but everything is very straightforward. Do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure&lt;br /&gt;
 make&lt;br /&gt;
 make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have multiple versions of wxWidgets installed or kept them in place, you can use:&lt;br /&gt;
 ./configure --with-wx-config=/path/to/wx-config&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The Nassi Shneiderman plugin (part of the contrib plugins) has a dependency on [http://www.boost.org boost] which is needed to compile this plugin. Boost does not need to be compiled therefore. It is not checked for the existing of boost at the moment (except for debian build-system, there it is a build-dependency), so if you configure C::B to be build without Nassi Schneiderman, it should not lead to problems in case you don't have/want boost.&lt;br /&gt;
&lt;br /&gt;
To uninstall you can later run:&lt;br /&gt;
 make uninstall&lt;br /&gt;
&lt;br /&gt;
If you want to recompile everything, first run:&lt;br /&gt;
&amp;lt;pre&amp;gt; make clean&lt;br /&gt;
 make distclean&lt;br /&gt;
 make clean-bin&lt;br /&gt;
 make clean-zipfiles&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then follow the above sequence for installing.&lt;br /&gt;
&lt;br /&gt;
By default, CodeBlocks will install to /usr/local.  If you want it in its own tree (so you can have multiple versions of CodeBlocks, each in its own subdirectory of /opt) replace the above ./configure command with:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --prefix=/opt/codeblocks-svn&amp;lt;/pre&amp;gt;&lt;br /&gt;
or similar.  Then you can later install a different build like:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --prefix=/opt/codeblocks2-svn&amp;lt;/pre&amp;gt;&lt;br /&gt;
followed by 'make &amp;amp;&amp;amp; make install' as usual.&lt;br /&gt;
&lt;br /&gt;
By default, CodeBlocks will not compile the contributed plugins from SVN.  If you want to compile / install them too, replace the above ./configure command with:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --with-contrib-plugins=all&amp;lt;/pre&amp;gt;&lt;br /&gt;
followed by 'make &amp;amp;&amp;amp; make install' as usual.&lt;br /&gt;
&lt;br /&gt;
To see a list of other options available for configuring the build of CodeBlocks do:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile under ''Gentoo'', use:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --with-wx-config=wx-config-2.8&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Resolving issues====&lt;br /&gt;
&lt;br /&gt;
When running Code::Blocks after the installation it might happen, that the system complains:&lt;br /&gt;
 codeblocks: error while loading shared libraries: libcodeblocks.so.0: cannot open shared object file: No such file or directory&lt;br /&gt;
In that case make sure the library path where the Code::Blocks libraries where installed into is &amp;quot;known&amp;quot; to the system. For example: On Ubuntu using a default build process on a clean system will install the Code::Blocks executables to /use/local/bin and the libraries to /usr/local/lib. The latter is usually not known to a &amp;quot;clean&amp;quot; Ubuntu system. To add it to the search path for libraries do the following (as root / using sudo respectively):&lt;br /&gt;
Add the following line to the file /etc/ld.so.conf:&lt;br /&gt;
 /usr/local/lib&lt;br /&gt;
...and run:&lt;br /&gt;
 ldconfig&lt;br /&gt;
That's it - Code::Blocks should now work just fine as all libraries are being found.&lt;/div&gt;</summary>
		<author><name>Abi79</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux&amp;diff=6595</id>
		<title>Installing Code::Blocks from source on Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux&amp;diff=6595"/>
		<updated>2011-06-17T22:24:27Z</updated>

		<summary type="html">&lt;p&gt;Abi79: Small cleanup&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;
These are instructions on how to build Code::Blocks under Linux. These instructions should work for all Linux distros, as we'll be installing from sources.&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
In order to successfully compile Code::Blocks, the [http://en.wikipedia.org/wiki/WxWidgets wxWidgets] User Interface library &amp;lt;u&amp;gt;must be installed&amp;lt;/u&amp;gt;. For most Linux users, this is maybe the only dependency not already installed. wxWidget can be used directly on top of the X server, in this case the variant of the wxWidget library is called wxX11. However this library [http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits#Why_You_Shouldn.27t_Use_wxWidgets &amp;quot;is sub-par compared to other toolkits and unstable&amp;quot;]. Hence Code::Blocks uses wxGTK, the version of wxWidget based on GTK+. The exact requirement is libwxGTK-2.8.0 or later (2.8.3 is not recommanded because of some troubles). This creates an additional dependency on GTK+, consider the following:&lt;br /&gt;
&lt;br /&gt;
A possible implementation which does not exist: &lt;br /&gt;
&lt;br /&gt;
''Code::Blocks  -&amp;gt;  xwWidget (libwxX11)  -&amp;gt;  X''&lt;br /&gt;
&lt;br /&gt;
Current Code::Blocks implementation: &lt;br /&gt;
&lt;br /&gt;
''Code::Blocks  -&amp;gt;  '''xwWidget (&amp;gt; libwxGTK2.8)'''  -&amp;gt;  '''GTK+ (&amp;gt; libgtk-x11-2.0)'''  -&amp;gt;  X''&lt;br /&gt;
&lt;br /&gt;
This document helps you to install libwxGTK if necessary but does not cover the installation of GTK+. GTK+ is probably installed on your Linux anyway, so don't worry ;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Note:'' All the instructions below, assume an existing directory named &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;. If you 'll be using a different one, adjust the path to match.&lt;br /&gt;
As a first step create this directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking the presence of GTK+ library ===&lt;br /&gt;
&lt;br /&gt;
Have a look in /usr/lib for something like &amp;quot;libgtk-x11-2.0.so&amp;quot; (Note the library must be 2.0 minimum). Alternatively, do a search with your package manager or go to your Linux distribution forum for help. If you don't want to loose time, you can even forget this check since there is a good probability that everything is already installed.&lt;br /&gt;
&lt;br /&gt;
===Library wxGTK installation===&lt;br /&gt;
&lt;br /&gt;
==== Checking the presence of libwxGTK library ====&lt;br /&gt;
&lt;br /&gt;
In your package manager, look for 'libwxgtk' keyword and verify that '''all''' libwxgtk2.8 stuffs are installed. If you find the libraries uninstalled, just '''install them and go directly to [https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux#Code::Blocks_installation Code::Blocks installation]'''.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do the same in the command line (the following is an example, there may be more than two packages):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ls /usr/lib/libwx_gtk* //to verify the presence&lt;br /&gt;
$ sudo apt-get install libwxgtk2.8-dev&lt;br /&gt;
$ sudo apt-get install libwxgtk2.8-0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don't find any packages you must install the library from source as described below, and you can redo this check afterwards to verify that the installation worked correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Note for Debian and Ubuntu users:'' You can use &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ update-alternatives --config wx-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to see which version of libwx is there or not and currently active.&lt;br /&gt;
&lt;br /&gt;
====Getting wxGTK sources====&lt;br /&gt;
&lt;br /&gt;
Visit the [http://www.wxwidgets.org wxWidgets web site]. Click the &amp;quot;Download&amp;quot; button at the top of the page. Under wxWidgets 2.8.7 downloads, select wxGTK. Save the file in &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;. After the download finishes, switch to &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, untar the wxGTK sources:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar zxf wxGTK-2.8.7.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Switch to the wxGTK directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd wxGTK-2.8.7&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wxWidgets build====&lt;br /&gt;
&lt;br /&gt;
Here we will create a separate build directory instead of building from the src directory, so that we can easily rebuild with different options (unicode / ansi, monolithic / many libs, etc).&lt;br /&gt;
&lt;br /&gt;
The documentation says the default is for gtk2 to use unicode and wx &amp;gt; 2.5 to build as a monolithic library.  This doesn't appear to be the case, so these flags are passed to configure.&lt;br /&gt;
&lt;br /&gt;
 mkdir build_gtk2_shared_monolithic_unicode&lt;br /&gt;
 cd build_gtk2_shared_monolithic_unicode&lt;br /&gt;
 ../configure --prefix=/opt/wx/2.8 \&lt;br /&gt;
        --enable-xrc \&lt;br /&gt;
        --enable-monolithic \&lt;br /&gt;
        --enable-unicode&lt;br /&gt;
 make&lt;br /&gt;
 su&lt;br /&gt;
 make install&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
Add /opt/wx/2.8/bin to the PATH (if you're shell is bash then edit /etc/profile or ~/.bash_profile)&lt;br /&gt;
(On Suse 10.1 edit /etc/profile.local, it will only be available after a new login).  an example PATH&lt;br /&gt;
 export PATH=/usr/bin:/opt/wx/2.8/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
Add /opt/wx/2.8/lib to /etc/ld.so.conf (nano /etc/ld.so.conf)&lt;br /&gt;
then run:&lt;br /&gt;
 ldconfig&lt;br /&gt;
 source /etc/profile&lt;br /&gt;
&lt;br /&gt;
That's it.  Now the linker will look in /opt/wx/2.8/lib for wx libraries and you will have a monolithic shared library unicode build.&lt;br /&gt;
&lt;br /&gt;
To check that things are working, type:&lt;br /&gt;
 wx-config --prefix&lt;br /&gt;
which should give you /opt/wx/2.8&lt;br /&gt;
 wx-config --libs&lt;br /&gt;
which should have at least&lt;br /&gt;
 -L/opt/wx/2.8/lib -lwx_gtk2-2.8&lt;br /&gt;
but can contain other flags as well.&lt;br /&gt;
 which wx-config&lt;br /&gt;
should return /opt/wx/2.8/bin/wx-config&lt;br /&gt;
&lt;br /&gt;
===Code::Blocks installation===&lt;br /&gt;
&lt;br /&gt;
====Getting Code::Blocks sources====&lt;br /&gt;
&lt;br /&gt;
You can get Code::Blocks source code [https://www.codeblocks.org/downloads/6 from the website as a tarball] or from the SVN repository (this second method is described below).&lt;br /&gt;
&lt;br /&gt;
=====From SVN repository=====&lt;br /&gt;
NOTICE: The Sourceforge CVS is no longer used although it still exists&lt;br /&gt;
&lt;br /&gt;
Enter your development directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then checkout the source using one of [https://www.codeblocks.org/downloads/7 these] methods. This will create the directory &amp;lt;tt&amp;gt;trunk&amp;lt;/tt&amp;gt;. Change to the source code directory, by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd trunk&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are a Gentoo user at this point, please see [[Compiling_Code::Blocks_in_Gentoo]].&lt;br /&gt;
&lt;br /&gt;
Before beginning, it is often a good idea to check you have recent versions of autoconf and automake - repositories versions are not always recent enough. (if you do not have automake, then you will get &amp;quot;cannot find aclocal&amp;quot; error). If you're compiling the svn trunk versions of CodeBlocks (or future versions) then the unix build has switched to autotools.  So first build wxWidgets as described above and then build CodeBlocks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ./bootstrap&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up the configure script and its dependencies.  It only needs to be run once (after downloading the source from svn).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''If you get errors like:'''&lt;br /&gt;
 aclocal:configure.in:61: warning: macro `AM_OPTIONS_WXCONFIG' not found in library&lt;br /&gt;
Then aclocal is having trouble finding the wxWidgets .m4 files.  You can do one of two things:&lt;br /&gt;
To just get bootstrap to find the path this time do:&lt;br /&gt;
&amp;lt;!-- *********** Bad syntax... removed 2006-08-28 by BentFX ****************************&lt;br /&gt;
 export ACLOCAL_FLAGS=&amp;quot;--acdir=`wx-config --prefix`/share/aclocal&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: Note: The above command resulted in missing macros when running ./bootstrap for me. Setting an additional search path instead of overwriting like above worked for me. In case of missing macros try &lt;br /&gt;
***********************************************************************************--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;export ACLOCAL_FLAGS=&amp;quot;-I `wx-config --prefix`/share/aclocal&amp;quot;&amp;lt;/pre&amp;gt; &amp;lt;!--[[User:Jabber|Jabber]] 06:24, 2 August 2006 (EDT)--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change the aclocal search path more permanently do:&lt;br /&gt;
 echo `wx-config --prefix`/share/aclocal &amp;gt;&amp;gt; /usr/share/aclocal/dirlist&lt;br /&gt;
Then aclocal will also search somewhere like /opt/wx/2.6/share/aclocal&lt;br /&gt;
&lt;br /&gt;
'''''Note for Ubuntu users:''''' The above is not the correct way to fix the AM_* errors. Rather, you only need to install the package named &amp;quot;wx-common&amp;quot; (Universe repository).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you get something like&lt;br /&gt;
 The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'&lt;br /&gt;
&lt;br /&gt;
it can be solved by something like: (adapt path, use `wx-config --prefix` is necessary)&lt;br /&gt;
&lt;br /&gt;
 ACLOCAL_FLAGS=&amp;quot;-I /usr/share/aclocal&amp;quot; ./bootstrap&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''If you run ./bootstrap and get errors like''':&lt;br /&gt;
 bad interpreter: File not found&lt;br /&gt;
then there exists a problem with DOS line-endings. i had this error after i tried to build a  codeblocks from sources which were checked out with cvs on a windows machine. After i checked out a fresh copy of codeblocks from cvs under Ubuntu linux (see above topic: Downloading the latest source package fom SVN), all errors were gone. &lt;br /&gt;
//tiwag 051008*)&amp;lt;br&amp;gt;&lt;br /&gt;
Or, instead of downloading from SVN, you might consider using the little command line tool dos2unix, which normally comes with most distributions. //lizzarddude060103&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If configure aborts with some unspecific error message(&amp;quot;.infig.status: error: cannot find input file: Makefile&amp;quot;), you might consider also running dos2unix bootstrap acinclude.m4 codeblocks.pc.in configure.in Makefile.am before running bootstrap. Once you've run the bootstrap script, jump to next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Installing Code::Blocks sources====&lt;br /&gt;
You can read the BUILD file included in the source, but everything is very straightforward. Do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure&lt;br /&gt;
 make&lt;br /&gt;
 make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have multiple versions of wxWidgets installed or kept them inplace, you can use&lt;br /&gt;
./configure --with-wx-config=/path/to/wx-config&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The Nassi Shneiderman plugin (part of the contrib plugins) has a dependency on [http://www.boost.org boost] which is needed to compile this plugin. Boost does not need to be compiled therefore. It is not checked for the existing of boost at the moment (except for debian build-system, there it is a build-dependency), so if you configure C::B to be build without Nassi Schneiderman, it should not lead to problems in case you don't have/want boost.&lt;br /&gt;
&lt;br /&gt;
To uninstall you can later run:&lt;br /&gt;
 make uninstall&lt;br /&gt;
&lt;br /&gt;
If you want to recompile everything, first run:&lt;br /&gt;
&amp;lt;pre&amp;gt; make clean&lt;br /&gt;
 make distclean&lt;br /&gt;
 make clean-bin&lt;br /&gt;
 make clean-zipfiles&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then follow the above sequence for installing.&lt;br /&gt;
&lt;br /&gt;
By default, CodeBlocks will install to /usr/local.  If you want it in its own tree (so you can have multiple versions of CodeBlocks, each in its own subdirectory of /opt) replace the above ./configure command with:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --prefix=/opt/codeblocks-svn&amp;lt;/pre&amp;gt;&lt;br /&gt;
or similar.  Then you can later install a different build like:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --prefix=/opt/codeblocks2-svn&amp;lt;/pre&amp;gt;&lt;br /&gt;
followed by 'make &amp;amp;&amp;amp; make install' as usual.&lt;br /&gt;
&lt;br /&gt;
By default, CodeBlocks will not compile the contributed plugins from SVN.  If you want to compile / install them too, replace the above ./configure command with:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --with-contrib-plugins=all&amp;lt;/pre&amp;gt;&lt;br /&gt;
followed by 'make &amp;amp;&amp;amp; make install' as usual.&lt;br /&gt;
&lt;br /&gt;
To see a list of other options available for configuring the build of CodeBlocks do:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile under gentoo, use&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --with-wx-config=wx-config-2.8&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Resolving issues====&lt;br /&gt;
&lt;br /&gt;
When running Code::Blocks after the installation it might happen, that the system complains:&lt;br /&gt;
 codeblocks: error while loading shared libraries: libcodeblocks.so.0: cannot open shared object file: No such file or directory&lt;br /&gt;
In that case make sure the library path where the Code::Blocks libraries where installed into is &amp;quot;known&amp;quot; to the system. For example: On Ubuntu using a default build process on a clean system will install the Code::Blocks executables to /use/local/bin and the libraries to /usr/local/lib. The latter is usually not known to a &amp;quot;clean&amp;quot; Ubuntu system. To add it to the search path for libraries do the following (as root / using sudo respectively):&lt;br /&gt;
Add the following line to the file /etc/ld.so.conf:&lt;br /&gt;
 /usr/local/lib&lt;br /&gt;
...and run:&lt;br /&gt;
 ldconfig&lt;br /&gt;
That's it - Code::Blocks should now work just fine as all libraries are being found.&lt;/div&gt;</summary>
		<author><name>Abi79</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux&amp;diff=6594</id>
		<title>Installing Code::Blocks from source on Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux&amp;diff=6594"/>
		<updated>2011-06-17T20:08:52Z</updated>

		<summary type="html">&lt;p&gt;Abi79: /* Checking the presence of libwxGTK library */ Confirmed, upodate-alternatives works on Ubuntu Natty&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;
These are instructions on how to build Code::Blocks under Linux. These instructions should work for all Linux distros, as we'll be installing from sources.&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
In order to successfully compile Code::Blocks, the [http://en.wikipedia.org/wiki/WxWidgets wxWidgets] User Interface library &amp;lt;u&amp;gt;must be installed&amp;lt;/u&amp;gt;. For most Linux users, this is maybe the only dependency not already installed. wxWidget can be used directly on top of the X server, in this case the variant of the wxWidget library is called wxX11. However this library [http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits#Why_You_Shouldn.27t_Use_wxWidgets &amp;quot;is sub-par compared to other toolkits and unstable&amp;quot;]. Hence Code::Blocks uses wxGTK, the version of wxWidget based on GTK+. The exact requirement is libwxGTK-2.8.0 or later (2.8.3 is not recommanded because of some troubles). This creates an additional dependency on GTK+, consider the following:&lt;br /&gt;
&lt;br /&gt;
A possible implementation which does not exist: &lt;br /&gt;
&lt;br /&gt;
''Code::Blocks  -&amp;gt;  xwWidget (libwxX11)  -&amp;gt;  X''&lt;br /&gt;
&lt;br /&gt;
Current Code::Blocks implementation: &lt;br /&gt;
&lt;br /&gt;
''Code::Blocks  -&amp;gt;  '''xwWidget (&amp;gt; libwxGTK2.8)'''  -&amp;gt;  '''GTK+ (&amp;gt; libgtk-x11-2.0)'''  -&amp;gt;  X''&lt;br /&gt;
&lt;br /&gt;
This document helps you to install libwxGTK if necessary but does not cover the installation of GTK+. GTK+ is probably installed on your Linux anyway, so don't worry ;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Note:'' All the instructions below, assume an existing directory named &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;. If you 'll be using a different one, adjust the path to match.&lt;br /&gt;
As a first step create this directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking the presence of GTK+ library ===&lt;br /&gt;
&lt;br /&gt;
Have a look in /usr/lib for something like &amp;quot;libgtk-x11-2.0.so&amp;quot; (Note the library must be 2.0 minimum). Alternatively, do a search with your package manager or go to your Linux distribution forum for help. If you don't want to loose time, you can even forget this check since there is a good probability that everything is already installed.&lt;br /&gt;
&lt;br /&gt;
===Library wxGTK installation===&lt;br /&gt;
&lt;br /&gt;
==== Checking the presence of libwxGTK library ====&lt;br /&gt;
&lt;br /&gt;
In your package manager, look for 'libwxgtk' keyword and verify that '''all''' libwxgtk2.8 stuffs are installed. If you find the libraries uninstalled, well '''just install them and go directly to [https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux#Code::Blocks_installation Code::Blocks installation]'''.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do the same in command line (to give an idea, I don't say there is only 2 packages):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ls /usr/lib/libwx_gtk* //to verify the presence&lt;br /&gt;
$ sudo apt-get install libwxgtk2.8-dev&lt;br /&gt;
$ sudo apt-get install libwxgtk2.8-0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don't find any package you must install the library from source as described below, and you can redo this check afterwards to verify that the installation worked correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Note for Debian and Ubuntu users:'' You can use &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ update-alternatives --config wx-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to see which version of libwx is there or not and currently active.&lt;br /&gt;
&lt;br /&gt;
====Getting wxGTK sources====&lt;br /&gt;
&lt;br /&gt;
Visit the [http://www.wxwidgets.org wxWidgets web site]. Click the &amp;quot;Download&amp;quot; button at the top of the page. Under wxWidgets 2.8.7 downloads, select wxGTK. Save the file in &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;. After the download finishes, switch to &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, untar the wxGTK sources:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar zxf wxGTK-2.8.7.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Switch to the wxGTK directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd wxGTK-2.8.7&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wxWidgets build====&lt;br /&gt;
&lt;br /&gt;
Here we will create a seperate build directory instead of building from the src directory, so that we can easily rebuild with different options (unicode / ansi, monolithic / many libs, etc).&lt;br /&gt;
&lt;br /&gt;
The documentation says the default is for gtk2 to use unicode and wx &amp;gt; 2.5 to build as a monolithic library.  This doesn't appear to be the case, so these flags are passed to configure.&lt;br /&gt;
&lt;br /&gt;
 mkdir build_gtk2_shared_monolithic_unicode&lt;br /&gt;
 cd build_gtk2_shared_monolithic_unicode&lt;br /&gt;
 ../configure --prefix=/opt/wx/2.8 \&lt;br /&gt;
        --enable-xrc \&lt;br /&gt;
        --enable-monolithic \&lt;br /&gt;
        --enable-unicode&lt;br /&gt;
 make&lt;br /&gt;
 su&lt;br /&gt;
 make install&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
Add /opt/wx/2.8/bin to the PATH (if you're shell is bash then edit /etc/profile or ~/.bash_profile)&lt;br /&gt;
(On Suse 10.1 edit /etc/profile.local, it will only be available after a new login).  an example PATH&lt;br /&gt;
 export PATH=/usr/bin:/opt/wx/2.8/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
add /opt/wx/2.8/lib to /etc/ld.so.conf (nano /etc/ld.so.conf)&lt;br /&gt;
then run:&lt;br /&gt;
 ldconfig&lt;br /&gt;
 source /etc/profile&lt;br /&gt;
&lt;br /&gt;
That's it.  Now the linker will look in /opt/wx/2.8/lib for wx libraries and you will have a monolithic shared library unicode build.&lt;br /&gt;
&lt;br /&gt;
To check that things are working, type:&lt;br /&gt;
 wx-config --prefix&lt;br /&gt;
which should give you /opt/wx/2.8&lt;br /&gt;
 wx-config --libs&lt;br /&gt;
which should have at least&lt;br /&gt;
 -L/opt/wx/2.8/lib -lwx_gtk2-2.8&lt;br /&gt;
but can contain other flags as well.&lt;br /&gt;
 which wx-config&lt;br /&gt;
should return /opt/wx/2.8/bin/wx-config&lt;br /&gt;
&lt;br /&gt;
===Code::Blocks installation===&lt;br /&gt;
&lt;br /&gt;
====Getting Code::Blocks sources====&lt;br /&gt;
&lt;br /&gt;
You can get Code::Blocks source code [https://www.codeblocks.org/downloads/6 from the website as a tarball] or from the SVN repository (this second method is described below).&lt;br /&gt;
&lt;br /&gt;
=====From SVN repository=====&lt;br /&gt;
NOTICE: The Sourceforge CVS is no longer used although it still exists&lt;br /&gt;
&lt;br /&gt;
Enter your development directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then checkout the source using one of [https://www.codeblocks.org/downloads/7 these] methods. This will create the directory &amp;lt;tt&amp;gt;trunk&amp;lt;/tt&amp;gt;. Change to the source code directory, by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd trunk&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are a Gentoo user at this point, please see [[Compiling_Code::Blocks_in_Gentoo]].&lt;br /&gt;
&lt;br /&gt;
Before beginning, it is often a good idea to check you have recent versions of autoconf and automake - repositories versions are not always recent enough. (if you do not have automake, then you will get &amp;quot;cannot find aclocal&amp;quot; error). If you're compiling the svn trunk versions of CodeBlocks (or future versions) then the unix build has switched to autotools.  So first build wxWidgets as described above and then build CodeBlocks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ./bootstrap&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up the configure script and its dependencies.  It only needs to be run once (after downloading the source from svn).  '''If you get errors like:'''&lt;br /&gt;
 aclocal:configure.in:61: warning: macro `AM_OPTIONS_WXCONFIG' not found in library&lt;br /&gt;
Then aclocal is having trouble finding the wxWidgets .m4 files.  You can do one of two things:&lt;br /&gt;
To just get bootstrap to find the path this time do:&lt;br /&gt;
&amp;lt;!-- *********** Bad syntax... removed 2006-08-28 by BentFX ****************************&lt;br /&gt;
 export ACLOCAL_FLAGS=&amp;quot;--acdir=`wx-config --prefix`/share/aclocal&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: Note: The above command resulted in missing macros when running ./bootstrap for me. Setting an additional search path instead of overwriting like above worked for me. In case of missing macros try &lt;br /&gt;
***********************************************************************************--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;export ACLOCAL_FLAGS=&amp;quot;-I `wx-config --prefix`/share/aclocal&amp;quot;&amp;lt;/pre&amp;gt; &amp;lt;!--[[User:Jabber|Jabber]] 06:24, 2 August 2006 (EDT)--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change the aclocal search path more permanently do:&lt;br /&gt;
 echo `wx-config --prefix`/share/aclocal &amp;gt;&amp;gt; /usr/share/aclocal/dirlist&lt;br /&gt;
Then aclocal will also search somewhere like /opt/wx/2.6/share/aclocal&lt;br /&gt;
&lt;br /&gt;
'''''Note for Ubuntu users:''''' The above is not the correct way to fix the AM_* errors. Rather, you only need to install the package named &amp;quot;wx-common&amp;quot; (Universe repository).&lt;br /&gt;
&lt;br /&gt;
If you get something like&lt;br /&gt;
 The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'&lt;br /&gt;
&lt;br /&gt;
it can be solved by something like: (adapt path, use `wx-config --prefix` is necessary)&lt;br /&gt;
&lt;br /&gt;
 ACLOCAL_FLAGS=&amp;quot;-I /usr/share/aclocal&amp;quot; ./bootstrap&lt;br /&gt;
&lt;br /&gt;
(*Note// '''If you run ./bootstrap and get errors like''':&lt;br /&gt;
 : bad interpreter: File not found&lt;br /&gt;
then there exists a problem with DOS line-endings. i had this error after i tried to build a  codeblocks from sources which were checked out with cvs on a windows machine. After i checked out a fresh copy of codeblocks from cvs under Ubuntu linux (see above topic: Downloading the latest source package fom SVN), all errors were gone. &lt;br /&gt;
//tiwag 051008*)&amp;lt;br&amp;gt;&lt;br /&gt;
Or, instead of downloading from SVN, you might consider using the little command line tool dos2unix, which normally comes with most distributions. //lizzarddude060103&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If configure aborts with some unspecific error message(&amp;quot;.infig.status: error: cannot find input file: Makefile&amp;quot;), you might consider also running dos2unix bootstrap acinclude.m4 codeblocks.pc.in configure.in Makefile.am before running bootstrap. Once you've run the bootstrap script, jump to next step.&lt;br /&gt;
&lt;br /&gt;
====Installing Code::Blocks sources====&lt;br /&gt;
You can read the BUILD file included in the source, but everything is very straightforward. Do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure&lt;br /&gt;
 make&lt;br /&gt;
 make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have multiple versions of wxWidgets installed or kept them inplace, you can use&lt;br /&gt;
./configure --with-wx-config=/path/to/wx-config&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The Nassi Shneiderman plugin (part of the contrib plugins) has a dependency on [http://www.boost.org boost] which is needed to compile this plugin. Boost does not need to be compiled therefore. It is not checked for the existing of boost at the moment (except for debian build-system, there it is a build-dependency), so if you configure C::B to be build without Nassi Schneiderman, it should not lead to problems in case you don't have/want boost.&lt;br /&gt;
&lt;br /&gt;
To uninstall you can later run:&lt;br /&gt;
 make uninstall&lt;br /&gt;
&lt;br /&gt;
If you want to recompile everything, first run:&lt;br /&gt;
&amp;lt;pre&amp;gt; make clean&lt;br /&gt;
 make distclean&lt;br /&gt;
 make clean-bin&lt;br /&gt;
 make clean-zipfiles&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then follow the above sequence for installing.&lt;br /&gt;
&lt;br /&gt;
By default, CodeBlocks will install to /usr/local.  If you want it in its own tree (so you can have multiple versions of CodeBlocks, each in its own subdirectory of /opt) replace the above ./configure command with:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --prefix=/opt/codeblocks-svn&amp;lt;/pre&amp;gt;&lt;br /&gt;
or similar.  Then you can later install a different build like:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --prefix=/opt/codeblocks2-svn&amp;lt;/pre&amp;gt;&lt;br /&gt;
followed by 'make &amp;amp;&amp;amp; make install' as usual.&lt;br /&gt;
&lt;br /&gt;
By default, CodeBlocks will not compile the contributed plugins from SVN.  If you want to compile / install them too, replace the above ./configure command with:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --with-contrib-plugins=all&amp;lt;/pre&amp;gt;&lt;br /&gt;
followed by 'make &amp;amp;&amp;amp; make install' as usual.&lt;br /&gt;
&lt;br /&gt;
To see a list of other options available for configuring the build of CodeBlocks do:&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile under gentoo, use&lt;br /&gt;
&amp;lt;pre&amp;gt; ./configure --with-wx-config=wx-config-2.8&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Resolving issues====&lt;br /&gt;
&lt;br /&gt;
When running Code::Blocks after the installation it might happen, that the system complains:&lt;br /&gt;
 codeblocks: error while loading shared libraries: libcodeblocks.so.0: cannot open shared object file: No such file or directory&lt;br /&gt;
In that case make sure the library path where the Code::Blocks libraries where installed into is &amp;quot;known&amp;quot; to the system. For example: On Ubuntu using a default build process on a clean system will install the Code::Blocks executables to /use/local/bin and the libraries to /usr/local/lib. The latter is usually not known to a &amp;quot;clean&amp;quot; Ubuntu system. To add it to the search path for libraries do the following (as root / using sudo respectively):&lt;br /&gt;
Add the following line to the file /etc/ld.so.conf:&lt;br /&gt;
 /usr/local/lib&lt;br /&gt;
...and run:&lt;br /&gt;
 ldconfig&lt;br /&gt;
That's it - Code::Blocks should now work just fine as all libraries are being found.&lt;/div&gt;</summary>
		<author><name>Abi79</name></author>
	</entry>
</feed>