Skip to content

build_linux_mint_18

LETARTARE edited this page Jul 25, 2019 · 15 revisions

Installing Codeblocks from source on linux mint 18


WORK IN PROGRESS


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.

Setup build system

First we need a compiler and some other tools to build codeblocks.

  1. Open a terminal (iiiek terminal) window by clicking on the terminal symbol (at the bottom the black symbol with ">_" in it)
  2. 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.
  3. Enter your admin password if asked and confirm any question with Y (or hit enter)

Build codeblocks with system default wxWidgets

Codeblocks uses wxWidgets as window framework, so first step is to install wxWidgets

Installing wxWidgets

  1. Open a terminal
  2. type sudo apt install libwxgtk3.0-dev
  3. Again enter your password and confirm everything with yes

Install other needed libraries

We need additional libraries for many plugins:

  1. Open a terminal
  2. type sudo apt install libgtk2.0-dev libhunspell-dev libgamin-dev libboost-dev libboost-system-dev libbz2-dev
  3. Again enter your password and confirm everything with yes

Building codeblocks with make and installing it

  1. Open a terminal
  2. Go to your home directory by typing cd ~ and hit enter
  3. Create a directory for codeblocks with mkdir codeblocks and go into this directory with cd codeblocks
  4. 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 with cd codeblocks-code
  5. run ./bootstrap
  6. run ./configure --with-contrib-plugins=all
  7. run make
  8. run sudo make install
  9. run sudo ldconfig

You can run codeblocks now by running codeblocksin a command line window

Uninstall codeblocks after installing it with make

  1. in the folder you run sudo make installyou run now sudo make uninstall

Building codeblocks to package

  1. Open a terminal
  2. Go to your home directory by typing cd ~ and hit enter
  3. Create a directory for codeblocks with mkdir codeblocks and go into this directory with cd codeblocks
  4. 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 with cd codeblocks-code
  5. run ./bootstrap
  6. create a debian package with dpkg-buildpackage -us -uc

Installing the package

Uninstalling codeblocks

Building wxWidgets 3.0

  1. create a folder with the name wxWidgets
  2. download the wx30 release code with wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.0.3/wxWidgets-3.0.3.tar.bz2
  3. extract it with tar -x -f wxWidgets-3.0.3.tar.bz2
  4. Go into the extracted directory: cd wxWidgets-3.0.3
  5. Configure wxWidgets ./configure --enable-unicode --enable-monolithic --enable-debug --enable-shared
  6. build it with make
  7. Install it with sudo make install

Building wxWidgets 2.8

This will build and install wxWidgets 2.8 so you can use it beside the wx30 installation of your system.

  1. create a folder with the name wxWidgets
  2. download the wx28 release code with wget https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxGTK-2.8.12.tar.gz
  3. extract it with tar -x -f wxGTK-2.8.12.tar.gz
  4. Go into the extracted directory: cd wxWidgets-2.8.12
  5. 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...

  1. Configure wxWidgets ./configure --enable-unicode --enable-monolithic --enable-debug --enable-shared --enable-display --prefix=/home/USERNAME/wxWidgets/install

Replace USERNAME with your username

  1. Patch the Makefile: If you are using a newer gcc you will also have to patch the Makefile:
  • Open the Makefilefile found in the wxWidgets folder.
  • Search for the Line CXXFLAGS = -DWX_PRECOMP -pthread -Wall -Wundef -Wno-ctor-dtor-privacy -g -O0 and replace it with CXXFLAGS = -DWX_PRECOMP -pthread -Wall -Wundef -Wno-ctor-dtor-privacy -g -O0 -Wno-narrowing
  • close
  1. build it with make
  2. 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 prefixoption in the configure part and install wx2.8 in the system directory you probably will fuck up your wx3 installation...

Building codeblocks with wxWidgets 2.8 installed in custom folder

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

  1. Open a terminal
  2. Go to your home directory by typing cd ~ and hit enter
  3. Create a directory for codeblocks with mkdir codeblocks and go into this directory with cd codeblocks
  4. 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 with cd codeblocks-code
  5. run ./bootstrap
  6. run ./configure --with-contrib-plugins=all --with-wx-config=/home/USERNAME/wxWidgets/install /home/USERNAME/wxWidgets/installis the path where you have installed wxWidgets
  7. run make
  8. run sudo make install
  9. run sudo ldconfig

You can run codeblocks now by running codeblocksin a command line window

Building codeblocks with codeblocks for development and custom plugins