Author Topic: Building Code::Blocks in Ubuntu  (Read 617 times)

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 40
Building Code::Blocks in Ubuntu
« on: September 03, 2017, 06:54:02 pm »
Hi,

According to BUILD file in Code::Blocks SVN, I tried:

Code: [Select]
./bootstrap
then
Code: [Select]
./configure --with-contrib-plugins=all
make
make install

But the process was interrupted several times due to packages that were not installed. Now after efforts to run I get:

Code: [Select]
mehdi@mehdi-X556UQK:~$ codeblocks
codeblocks: symbol lookup error: codeblocks: undefined symbol: cbDEFAULT_OPEN_FOLDER_CMD

What should I do ?

Offline blauzahn

  • Multiple posting newcomer
  • *
  • Posts: 70
Re: Building Code::Blocks in Ubuntu
« Reply #1 on: September 03, 2017, 07:40:09 pm »
Please try a rebuild. Installing things midway through the build might break that.

Code: [Select]
make clean
./configure --with-contrib-plugins=all
make
sudo make install

Depending on your CPU and RAM you might want to try running make in parallel:

Code: [Select]
make -j 4

Please be aware, that compiling some of the files needs a lot memory.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5973
    • My Best Post
Re: Building Code::Blocks in Ubuntu
« Reply #2 on: September 04, 2017, 02:10:18 am »
For those wondering where "cbDEFAULT_OPEN_FOLDER_CMD" is defined.

From file sdk/globals.cpp
Code: [Select]
#if defined __WXMSW__
const wxString cbDEFAULT_OPEN_FOLDER_CMD = _T("explorer.exe /select,");
#elif defined __WXMAC__
const wxString cbDEFAULT_OPEN_FOLDER_CMD = _T("open -R");
#else
const wxString cbDEFAULT_OPEN_FOLDER_CMD = _T("xdg-open");
#endif

Tim S.
« Last Edit: September 04, 2017, 04:05:22 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Building Code::Blocks in Ubuntu
« Reply #3 on: September 04, 2017, 07:15:01 am »
Please try a rebuild. Installing things midway through the build might break that.

Code: [Select]
make clean
./configure --with-contrib-plugins=all
make
sudo make install

[...]

I ran the commands on revision 11157 and build went on without seemingly any error. But I get this again :

Code: [Select]
mehdi@mehdi-X556UQK:~$ codeblocks
codeblocks: symbol lookup error: codeblocks: undefined symbol: cbDEFAULT_OPEN_FOLDER_CMD

Note that previously I was using a Launchpad link for Ubuntu :

https://launchpad.net/~damien-moore/+archive/ubuntu/codeblocks

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7220
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Building Code::Blocks in Ubuntu
« Reply #4 on: September 04, 2017, 08:35:55 am »
Run "which codeblocks" in the console and see if you run the self-build version, you can also try "ldd [/path/to/your/]codeblocks" to see if it uses the correct libraries, not the libraries from damien's version.
The securest way would be to completeley remove the "other" codeblocks and only keep yours.
You might also try to install it to a folder below your home folder with the "--prefix="-option when running configure.
This works on Fedora without clashing with the system-wide installed codeblocks.

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Building Code::Blocks in Ubuntu
« Reply #5 on: September 04, 2017, 11:16:01 am »
Run "which codeblocks" in the console and see if you run the self-build version, you can also try "ldd [/path/to/your/]codeblocks" to see if it uses the correct libraries, not the libraries from damien's version.
The securest way would be to completeley remove the "other" codeblocks and only keep yours.
You might also try to install it to a folder below your home folder with the "--prefix="-option when running configure.
This works on Fedora without clashing with the system-wide installed codeblocks.

Let's see:

Code: [Select]
mehdi@mehdi-X556UQK:~$ which codeblocks
/usr/local/bin/codeblocks

Code: [Select]
mehdi@mehdi-X556UQK:~$ ldd /usr/local/bin/codeblocks
linux-vdso.so.1 =>  (0x00007ffd4ffaa000)
libcodeblocks.so.0 => /usr/lib/libcodeblocks.so.0 (0x00007f28dabe1000)
libwx_gtk2u_aui-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_aui-3.0.so.0 (0x00007f28da948000)
libwx_gtk2u_propgrid-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_propgrid-3.0.so.0 (0x00007f28da660000)
libwx_gtk2u_xrc-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_xrc-3.0.so.0 (0x00007f28da2ef000)
libwx_gtk2u_html-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_html-3.0.so.0 (0x00007f28da013000)
libwx_gtk2u_qa-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_qa-3.0.so.0 (0x00007f28d9de3000)
libwx_gtk2u_adv-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_adv-3.0.so.0 (0x00007f28d99fd000)
libwx_gtk2u_core-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0 (0x00007f28d9184000)
libwx_baseu_net-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_baseu_net-3.0.so.0 (0x00007f28d8f38000)
libwx_baseu-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0 (0x00007f28d8aa6000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f28d8889000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f28d8507000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f28d82f1000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f28d7f27000)
libwx_baseu_xml-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_baseu_xml-3.0.so.0 (0x00007f28d7d17000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f28d7a06000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f28d76fd000)
libgtk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 (0x00007f28d70b2000)
libgdk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 (0x00007f28d6dfd000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f28d6baa000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f28d6988000)
libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f28d673c000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f28d6402000)
libnotify.so.4 => /usr/lib/x86_64-linux-gnu/libnotify.so.4 (0x00007f28d61fa000)
libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f28d5fed000)
libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f28d5cd9000)
libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f28d5ad3000)
libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f28d58cb000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f28d56a6000)
libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f28d544d000)
libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f28d51d9000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f28d4fbf000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f28d4dbb000)
/lib64/ld-linux-x86-64.so.2 (0x00007f28db49a000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f28d4b92000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f28d4922000)
libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f28d471e000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f28d4518000)
libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f28d42f3000)
libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f28d3f6b000)
libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f28d3d55000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f28d3b12000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f28d3908000)
libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f28d3705000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f28d34f5000)
libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f28d32ea000)
libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f28d30e0000)
libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007f28d2edd000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f28d2cda000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f28d2ac8000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f28d28c0000)
libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007f28d26b7000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f28d2495000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f28d21eb000)
libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f28d1f43000)
libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f28d1d3f000)
libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f28d1b35000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f28d192d000)
libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f28d1713000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f28d150e000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f28d12ec000)
libjbig.so.0 => /usr/lib/x86_64-linux-gnu/libjbig.so.0 (0x00007f28d10de000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f28d0ebc000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f28d0ca1000)
libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f28d0a43000)
libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f28d083b000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f28d0637000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f28d0431000)
libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f28d020b000)


How can I remove other codeblocks and keep only my codeblocks ?

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Building Code::Blocks in Ubuntu
« Reply #6 on: September 04, 2017, 05:50:32 pm »
Update:

In "Ubuntu Software" ,"Installed" tab, I see two "Code::Blocks IDE". Both are labeled "3rd party" and both have these details:

Version 16.01+p~launchpadrev9222~ubuntu16.04.1
Category Development Tools → IDE
License Open Source
Source LP-PPA-damien-moore-codeblocks
Size 8.1 MB

Both have Code::Blocks Plugins installed.

Offline blauzahn

  • Multiple posting newcomer
  • *
  • Posts: 70
Re: Building Code::Blocks in Ubuntu
« Reply #7 on: September 04, 2017, 07:31:03 pm »
My only (systemwide) cb is the one from trunk. No cb launchpad package.

Before my plain old Makefile executes a make install, it
moves the existing directories /usr/local/lib/codeblocks and /usr/local/share/codeblocks away
to avoid having stale older files lying around there. Sor some other progs I use checkinstall,
but not (yet) for cb.

Did you execute ./bootstrap again as well?

my configure to build out of tree:
Code: [Select]
mkdir -p $(BUILDDIR)
(cd $(BUILDDIR) && ../$(SRCDIR)/configure --prefix=$(PREFIX) --with-contrib-plugins=all,-NassiShneiderman)

Can you use a spare computer or virtual machine with a fresh ubuntu?
Useful to automate the steps in the cb wiki for your machine.
You can write down the steps to do so into a simple Makefile.
From cloning, updating, installing prerequisites, bootstrap, config, make, make install.
Once you have that Makefile, starting that from scratch will become a lot easier.

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Building Code::Blocks in Ubuntu
« Reply #8 on: September 05, 2017, 09:09:22 am »
Ok,

I removed codeblocks package using:
Code: [Select]
sudo apt remove codeblocks
then through "Synaptic Package Manager" some related packages were removed too. Now my built Code::Blocks seems to run fine.

Offline cacb

  • Regular
  • ***
  • Posts: 366
Re: Building Code::Blocks in Ubuntu
« Reply #9 on: September 05, 2017, 09:29:59 am »
Based on http://www.codeblocks.org/downloads/7 it looks like the code::blocks source is still on SVN, is that up to date info?
Somehow I had the idea that it had moved to Github, but maybe I am wrong?

I have been building successfully for Kubuntu from Jens' tarballs at https://apt.jenslody.de/stable/pool/main/ for quite some time, but the recent versions (from a few months ago) became very unstable under Kubuntu 17.04 (random crashes). It creates .deb files which appear to conflict with the standard packages when installed.

What is the best approach these days, fetch from SVN and build as described in this thread?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10369
Re: Building Code::Blocks in Ubuntu
« Reply #10 on: September 05, 2017, 09:38:18 am »
I have been building successfully for Kubuntu from Jens' tarballs at https://apt.jenslody.de/stable/pool/main/ for quite some time, but the recent versions (from a few months ago) became very unstable under Kubuntu 17.04 (random crashes). It creates .deb files which appear to conflict with the standard packages when installed.
I've fixed several bugs affecting ubuntu recently. Can you retest with the latest head sources and open a new ticket or start new topic if there are crashes?
To get the sources use the sf.net svn or you can use my clone in github - https://github.com/obfuscated/codeblocks_sf
<debugger plugin maintainer>
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Regular
  • ***
  • Posts: 366
Re: Building Code::Blocks in Ubuntu
« Reply #11 on: September 05, 2017, 10:51:55 am »
I've fixed several bugs affecting ubuntu recently. Can you retest with the latest head sources and open a new ticket or start new topic if there are crashes?
To get the sources use the sf.net svn or you can use my clone in github - https://github.com/obfuscated/codeblocks_sf
Thanks, I will give your clone a try.