<?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=Blondandy</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=Blondandy"/>
	<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php/Special:Contributions/Blondandy"/>
	<updated>2026-05-27T00:57:56Z</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=5571</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=5571"/>
		<updated>2008-08-10T15:03:51Z</updated>

		<summary type="html">&lt;p&gt;Blondandy: /* Building Code::Blocks SVN */ automake note&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 sucesfully compile Code::Blocks, the wxWidgets (&amp;lt;u&amp;gt;wxGTK-2.8.0 or later&amp;lt;/u&amp;gt;) cross-platform UI library &amp;lt;u&amp;gt;must be installed&amp;lt;/u&amp;gt;. In this document, it is not assumed that it is already installed in your system and instructions are given on how to download, build and install it.&lt;br /&gt;
What is '''not''' covered here, is the wxWidgets prerequisites. The most important being GTK2, of course!&lt;br /&gt;
Let me stress it here, while it's early: &amp;lt;u&amp;gt;GTK2 is required&amp;lt;/u&amp;gt;, not GTK1, for Code::Blocks to be operational.&lt;br /&gt;
&lt;br /&gt;
You do not need to Compile wxWidgets if your distribution has wxGTK 2.8 and wxGTK 2.8-dev package available.  A quick search for &amp;quot;wxGTK&amp;quot; through your respective package manager should show bring up the needed packages.  After you have installed successfully you can moving on the the Installing Code::Blocks portion.  If you are using Ubuntu and have installed the wxGTK package, you must also have the dev version as well as the &amp;quot;wx-common&amp;quot; package in order to successfully compile Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
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;
===wxGTK installation===&lt;br /&gt;
&lt;br /&gt;
====Getting wxGTK====&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;.&lt;br /&gt;
&lt;br /&gt;
====Uncompressing the wxGTK sources====&lt;br /&gt;
&lt;br /&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;
'''Note:''' On Ubuntu Hoary it was necessary to check &amp;quot;Run command as login shell&amp;quot; &lt;br /&gt;
in the gnome-terminal profile-settings, otherwise the PATH changes are not available in a gnome-terminal window.&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;
====Downloading Code::Blocks====&lt;br /&gt;
&lt;br /&gt;
You can get Code::Blocks source code in one way:&lt;br /&gt;
* Get the latest sources from the SVN repository.&lt;br /&gt;
This method is described below.&lt;br /&gt;
&lt;br /&gt;
=====Getting the latest sources from SVN=====&lt;br /&gt;
'''IMPORTANT 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.&lt;br /&gt;
&lt;br /&gt;
This will create the directory &amp;lt;tt&amp;gt;trunk&amp;lt;/tt&amp;gt;.&lt;br /&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;
====Building Code::Blocks SVN====&lt;br /&gt;
If you are a Gentoo user, 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).&lt;br /&gt;
&lt;br /&gt;
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;
 ./bootstrap&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&lt;br /&gt;
 dos2unix bootstrap acinclude.m4 codeblocks.pc.in configure.in Makefile.am&lt;br /&gt;
before running bootstrap&lt;br /&gt;
&lt;br /&gt;
Once you've run the bootstrap script, installing is as simple as:&lt;br /&gt;
 ./configure&lt;br /&gt;
 make&lt;br /&gt;
 make install&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;
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;
 make clean&lt;br /&gt;
 make distclean&lt;br /&gt;
 make clean-bin&lt;br /&gt;
 make clean-zipfiles&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;
 ./configure --prefix=/opt/codeblocks-svn&lt;br /&gt;
or similar.  Then you can later install a different build like:&lt;br /&gt;
 ./configure --prefix=/opt/codeblocks2-svn&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;
 ./configure --with-contrib-plugins=all&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;
 ./configure --help&lt;br /&gt;
&lt;br /&gt;
To compile under gentoo, use&lt;br /&gt;
 ./configure --with-wx-config=wx-config-2.8&lt;/div&gt;</summary>
		<author><name>Blondandy</name></author>
	</entry>
</feed>