Author Topic: Installing Code::Blocks from source on Linux  (Read 17629 times)

Offline cobramostar

  • Single posting newcomer
  • *
  • Posts: 1
Installing Code::Blocks from source on Linux
« on: October 11, 2024, 11:01:53 pm »
I tried to follow the procedures from the page https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux#Code::Blocks_installation , but from this part I didn't succeed because it asked me for sudo user, in fact it didn't want to miss cmd without sudo user

Code
$ update-alternatives --install /usr/bin/wx-config wx-config /opt/wx/2.8/bin/wx-config 50

has anyone been able to install Code::Blocks using these instructions ?

I would be grateful for any help

Offline Wkerry

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: Installing Code::Blocks from source on Linux
« Reply #1 on: October 12, 2024, 09:57:41 am »
Have a read of the following as they are way more up to date than the wiki page:
https://github.com/PBfordev/wxpbguide
https://forums.wxwidgets.org/viewtopic.php?t=47061


This previous thread may be of some use:
https://forums.codeblocks.org/index.php?topic=25811.0

Offline Krice

  • Almost regular
  • **
  • Posts: 164
Re: Installing Code::Blocks from source on Linux
« Reply #2 on: March 12, 2025, 12:25:46 pm »
I've tried to compile C::B in Fedora (from svn), I get this error, how to decipher it?

Code
/usr/bin/ld: warning: libtiff.so.5, needed by /usr/local/lib/libwx_gtk3u_aui-3.2.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFGetVersion@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFReadDirectory@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFReadRGBAImageOriented@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFDefaultStripSize@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFWriteScanline@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `_TIFFfree@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFGetField@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFScanlineSize@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFClose@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFClientOpen@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFRGBAImageOK@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFGetFieldDefaulted@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFSetField@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFSetWarningHandler@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFSetErrorHandler@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `_TIFFmalloc@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFSetDirectory@LIBTIFF_4.0'
/usr/bin/ld: /usr/local/lib/libwx_gtk3u_core-3.2.so: undefined reference to `TIFFReadScanline@LIBTIFF_4.0'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:731: codeblocks] Error 1
make[3]: Leaving directory '/home/krice/programs/cb/trunk/src/src'
make[2]: *** [Makefile:867: all-recursive] Error 1
make[2]: Leaving directory '/home/krice/programs/cb/trunk/src/src'
make[1]: *** [Makefile:539: all-recursive] Error 1
make[1]: Leaving directory '/home/krice/programs/cb/trunk/src'
make: *** [Makefile:671: all-recursive] Error 1

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1708
Re: Installing Code::Blocks from source on Linux
« Reply #3 on: March 12, 2025, 01:17:53 pm »
Looks like a dependency of wxWidgets, not of C::B.

Try installing package libtiff-dev (or whatever name Fedora uses for the package).

Offline Krice

  • Almost regular
  • **
  • Posts: 164
Re: Installing Code::Blocks from source on Linux
« Reply #4 on: March 12, 2025, 02:08:41 pm »
These libtiff packages are already installed:

libtiff.x86_64         4.6.0-6.fc41 fedora
libtiff-devel.x86_64  4.6.0-6.fc41 fedora

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1708
Re: Installing Code::Blocks from source on Linux
« Reply #5 on: March 12, 2025, 03:51:11 pm »
Does libtiff.so.5 exist in /usr/local/lib (or another searchable path)? If not, you can add a link to the proper libtiff.

Offline Krice

  • Almost regular
  • **
  • Posts: 164
Re: Installing Code::Blocks from source on Linux
« Reply #6 on: March 13, 2025, 11:18:01 am »
Libtiff is in usr/lib64 but it has libtiff.so, libtiff.so.6 and libtiff.so.6.0.2. Do I need version 5 or what. Linux library stuff is so confusing.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1708
Re: Installing Code::Blocks from source on Linux
« Reply #7 on: March 13, 2025, 01:38:03 pm »
Probably copying libtiff.so.6 to libtiff.so.5 is enough, but I would ask in the wxWidgets' forum.

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 543
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: Installing Code::Blocks from source on Linux
« Reply #8 on: March 14, 2025, 01:51:30 pm »
With 'Leap-15.6' we have the two versions which seem to coexist : 'libtiff.so.5' and  'libtiff.so.6'
CB-13634, plugins-sdk-2.25.0 : Collector-2.6.0, AddOnForQt-4.1.0
1- Win7 Business Pack1 64bits : wx-3.2.6, gcc-14.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.6;gtk3, gcc-13.3.0,
=> !! The messages are translated by 'Deepl'

Offline cacb

  • Lives here!
  • ****
  • Posts: 540
Re: Installing Code::Blocks from source on Linux
« Reply #9 on: March 14, 2025, 09:17:01 pm »
For building Code::Blocks from source under Kubuntu use build_cb.sh found  at
https://gitlab.com/arnholm/cpde_3rdparty/-/tree/master/gcc/codeblocks

Maybe it is helpful to some.

Offline Krice

  • Almost regular
  • **
  • Posts: 164
Re: Installing Code::Blocks from source on Linux
« Reply #10 on: March 16, 2025, 09:43:43 am »
In some unrelated projects people have solved this by creating a symlink to libtiff which in this case is libtiff.so.6.0.2 (other files are symlinks themselves) so I did that in my usr/lib64, but now it's just giving an error already in the compile phase, in astyle.h:

Code
In file included from asstreamiterator.h:15,
                 from asstreamiterator.cpp:10:
/usr/include/astyle.h:295:44: error: 'std::string_view' has not been declared
  295 |         const std::string* findHeader(std::string_view line, int i,
      |                                            ^~~~~~~~~~~

This seems to indicate that something doesn't include std::string header, right?

Edit: also, there could be some kind of confusion in including astyle.h in asstreamiterator.h. If you use angle brackets it's trying to find the file in usr/library while there is also plugins/astyle/astyle directory where you can find another astyle.h which is not included unless you write #include "astyle/astyle.h", well I guess depending how this project is handling that kind of stuff, could be something else happening.
« Last Edit: March 16, 2025, 10:20:32 am by Krice »

Offline SharkCZ

  • Almost regular
  • **
  • Posts: 134
Re: Installing Code::Blocks from source on Linux
« Reply #11 on: March 17, 2025, 04:30:29 pm »
You can get the latest nightly C::B for Fedora from https://copr.fedorainfracloud.org/coprs/sharkcz/danny/. As for the build procedure you can take a look at the spec file, it shows what package you need to have installed and what commands to run, see https://src.fedoraproject.org/rpms/codeblocks/blob/rawhide/f/codeblocks.spec
Code::Blocks package maintainer for Fedora and EPEL

Offline Krice

  • Almost regular
  • **
  • Posts: 164
Re: Installing Code::Blocks from source on Linux
« Reply #12 on: March 18, 2025, 07:18:36 pm »
it shows what package you need to have installed

Am I supposed to know how to read that? I think compiler errors could also hint that wxWidgets is missing, but it should be installed... Maybe I could try to write a wx program to see if it works. Anyway, how is this so difficult? I think this is more difficult than when I tried to compile Code::Blocks in OSX and that was a journey.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7739
    • My Best Post
Re: Installing Code::Blocks from source on Linux
« Reply #13 on: March 19, 2025, 12:53:56 am »
it shows what package you need to have installed

Am I supposed to know how to read that? I think compiler errors could also hint that wxWidgets is missing, but it should be installed... Maybe I could try to write a wx program to see if it works. Anyway, how is this so difficult? I think this is more difficult than when I tried to compile Code::Blocks in OSX and that was a journey.

The [linking] error posted implied wxWidgets was from an local build instead of being an Linux Distro package.
Did you build it recently? If yes, I have nothing to suggest. If no, I suggest building it again and see if the error changes or goes away.
And, the posting the reason you did the local build of wxWidgets might help people to help you.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Krice

  • Almost regular
  • **
  • Posts: 164
Re: Installing Code::Blocks from source on Linux
« Reply #14 on: March 19, 2025, 09:38:41 am »
I could have compiled wx from source but there was no source directory. Downloaded wx source, ran configure and then make uninstall. But it doesn't help. I think it did remove something from usr/local/lib, but it left wx directory with another empty wx directory at the end of it. wx can be also found from usr/lib64 and /lib64. How does it confuse compiler if it's installed in those locations, shouldn't the compiler choose one and not mix them, which could cause some problems? At this point I probably have to delete package wx, see if anything is left and delete those files manually, then reinstall it. Right? F-- linux...