build_linux_mint_18
WORK IN PROGRESS
- Setup build system
- Build codeblocks with system default wxWidgets
- Building wxWidgets 3.0
- Building wxWidgets 2.8
- Building codeblocks with wxWidgets 2.8 installed in custom folder
- Building codeblocks with codeblocks for development and custom plugins
This guide describes a step by step list to install codeblocks from source on a fresh linux mint 18.3 installation.
We will use only the command line because it is the most usefull and versatile tool, plus it is easy to use. If you never worked with the command line tool, please read this. It will make your work a lot easier.
First we need a compiler and some other tools to build codeblocks.
- Open a terminal (iiiek terminal) window by clicking on the terminal symbol (at the bottom the black symbol with ">_" in it)
- type
sudo apt install gcc build-essential subversion libtool autotools-dev automake debhelper cdbs
. This will install compiler and build tools to compile codeblocks and build a package to install it. - Enter your admin password if asked and confirm any question with Y (or hit enter)
Codeblocks uses wxWidgets as window framework, so first step is to install wxWidgets
- Open a terminal
- type
sudo apt install libwxgtk3.0-dev
- Again enter your password and confirm everything with yes
We need additional libraries for many plugins:
- Open a terminal
- type
sudo apt install libgtk2.0-dev libhunspell-dev libgamin-dev libboost-dev libboost-system-dev libbz2-dev
- Again enter your password and confirm everything with yes
- Open a terminal
- Go to your home directory by typing
cd ~
and hit enter - Create a directory for codeblocks with
mkdir codeblocks
and go into this directory withcd codeblocks
- Download the latest source code with
svn checkout https://svn.code.sf.net/p/codeblocks/code/trunk codeblocks-code
and change the directory to it withcd codeblocks-code
- run
./bootstrap
- run
./configure --with-contrib-plugins=all
- run
make
- run
sudo make install
- run
sudo ldconfig
You can run codeblocks now by running codeblocks
in a command line window
- in the folder you run
sudo make install
you run nowsudo make uninstall
- Open a terminal
- Go to your home directory by typing
cd ~
and hit enter - Create a directory for codeblocks with
mkdir codeblocks
and go into this directory withcd codeblocks
- Download the latest source code with
svn checkout https://svn.code.sf.net/p/codeblocks/code/trunk codeblocks-code
and change the directory to it withcd codeblocks-code
- run
./bootstrap
- create a debian package with
dpkg-buildpackage -us -uc
- create a folder with the name wxWidgets
- download the wx30 release code with
wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.0.3/wxWidgets-3.0.3.tar.bz2
- extract it with
tar -x -f wxWidgets-3.0.3.tar.bz2
- Go into the extracted directory:
cd wxWidgets-3.0.3
- Configure wxWidgets
./configure --enable-unicode --enable-monolithic --enable-debug --enable-shared
- build it with
make
- Install it with
sudo make install
This will build and install wxWidgets 2.8 so you can use it beside the wx30 installation of your system.
- create a folder with the name wxWidgets
- download the wx28 release code with
wget https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxGTK-2.8.12.tar.gz
- extract it with
tar -x -f wxGTK-2.8.12.tar.gz
- Go into the extracted directory:
cd wxWidgets-2.8.12
- Because of the last scintilla update you have to patch some files configure (see http://forums.codeblocks.org/index.php?topic=22658.0 thx Commaster):
diff --git a/configure b/configure
index f2ba453158..86ede0018a 100755
--- a/configure
+++ b/configure
@@ -24947,9 +24947,9 @@ SEARCH_INCLUDE="\
\
/usr/dt/include \
/usr/openwin/include \
- \
+ /usr/include \
/usr/include/Xm \
- \
+ /usr/include/x86_64-linux-gnu \
/usr/X11R6/include \
/usr/X11R6.4/include \
\
diff --git a/configure.in b/configure.in
index b73abca3c5..4c9492e7ed 100644
--- a/configure.in
+++ b/configure.in
@@ -2652,9 +2652,9 @@ SEARCH_INCLUDE="\
\
/usr/dt/include \
/usr/openwin/include \
- \
+ /usr/include \
/usr/include/Xm \
- \
+ /usr/include/x86_64-linux-gnu \
/usr/X11R6/include \
/usr/X11R6.4/include \
\
to use this patch, search for the configure.in
and configure
file int the wxWidgets folder, search for SEARCH_INCLUDE
and add the lines that have a single +
in front (for ex. add the line /usr/include/x86_64-linux-gnu \
in the list defined by SEARCH_INCLUDE
. Or simply google how to apply a patch file...
- Configure wxWidgets
./configure --enable-unicode --enable-monolithic --enable-debug --enable-shared --enable-display --prefix=/home/USERNAME/wxWidgets/install
Replace USERNAME
with your username
- Patch the Makefile: If you are using a newer gcc you will also have to patch the Makefile:
- Open the
Makefile
file found in the wxWidgets folder. - Search for the Line
CXXFLAGS = -DWX_PRECOMP -pthread -Wall -Wundef -Wno-ctor-dtor-privacy -g -O0
and replace it withCXXFLAGS = -DWX_PRECOMP -pthread -Wall -Wundef -Wno-ctor-dtor-privacy -g -O0 -Wno-narrowing
- close
- build it with
make
- Install it with
make install
. You should not have to use sudo, because you will install the library in your home directory
If you do not use the prefix
option in the configure part and install wx2.8 in the system directory you probably will fuck up your wx3 installation...
make sure you have installed all needed libraries from Install other needed libraries. Also make sure you have build and installed wxWidgets 2.8 Building wxWidgets 2.8
- Open a terminal
- Go to your home directory by typing
cd ~
and hit enter - Create a directory for codeblocks with
mkdir codeblocks
and go into this directory withcd codeblocks
- Download the latest source code with
svn checkout https://svn.code.sf.net/p/codeblocks/code/trunk codeblocks-code
and change the directory to it withcd codeblocks-code
- run
./bootstrap
- run
./configure --with-contrib-plugins=all --with-wx-config=/home/USERNAME/wxWidgets/install
/home/USERNAME/wxWidgets/install
is the path where you have installed wxWidgets - run
make
- run
sudo make install
- run
sudo ldconfig
You can run codeblocks now by running codeblocks
in a command line window