Author Topic: How to install codeblocks on raspberry pi 4?  (Read 2963 times)

Offline MBajor

  • Single posting newcomer
  • *
  • Posts: 8
How to install codeblocks on raspberry pi 4?
« on: March 05, 2021, 11:39:03 pm »
As I understand, there is no binary release of codeblocks 20.03 for the arm architecture.
Unfortunately, all my attempts to build wxGTK-2.8.12 failed. Because wxGTK-2.8.12 requires gtk+-2.8.0 which is no longer supported by the "sudo apt-get install -y libwxgtk2.8-dev" command. Attempts to build gtk+-2.8.0 also failed.
wxWidgets 3.1.4 are installed normally but I can't build a codeblocks on wxWidgets 3.1.4.
Does anyone have any idea how to install a code block on the arm architecture (Raspberry pi os)?

Offline AndrewCot

  • Almost regular
  • **
  • Posts: 196
Re: How to install codeblocks on raspberry pi 4?
« Reply #1 on: March 06, 2021, 05:20:13 am »
I suggest having a read in the forum for the following search results "wxWidgets 3.1.4" to see if/how you can use wxWidgets 3.1.4 when building the CB trunk code.

Offline MBajor

  • Single posting newcomer
  • *
  • Posts: 8
Re: How to install codeblocks on raspberry pi 4?
« Reply #2 on: March 06, 2021, 08:00:13 am »
Attempt to build code blocks on wxWidgets 3.1.4 gives me the following error after "make" command:
Quote
main.cpp: In member function ‘bool MainFrame::OnDropFiles(wxCoord, wxCoord, const wxArrayString&)’:
main.cpp:2682:22: error: ‘wxPaintEvent::wxPaintEvent(wxWindowBase*)’ is private within this context
         wxPaintEvent e;
                      ^
In file included from /usr/local/include/wx-3.1/wx/wx.h:24,
                 from /usr/local/include/wx-3.1/wx/wxprec.h:42,
                 from ./sdk_common.h:24,
                 from ./sdk_precomp.h:13,
                 from ./sdk.h:17:
/usr/local/include/wx-3.1/wx/event.h:2379:14: note: declared private here
     explicit wxPaintEvent(wxWindowBase* window = NULL);

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: How to install codeblocks on raspberry pi 4?
« Reply #3 on: March 06, 2021, 10:16:09 am »
Why are you installing 3.1.4? Regular 3.0.x is probably enough.

Also to use recent wx you need this patch https://sourceforge.net/p/codeblocks/code/11991/
(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 MBajor

  • Single posting newcomer
  • *
  • Posts: 8
Re: How to install codeblocks on raspberry pi 4?
« Reply #4 on: March 06, 2021, 03:48:20 pm »
After downloading the codeblocks from the SVN repository, the codeblocks was compiled and installed well even thru wxWidgets 3.1.4 (thank you AndrewCot and oBFusCATed). However, there was a problem when running it through the terminal. I'm getting an error:
Quote
codeblocks: symbol lookup error: codeblocks: undefined symbol: cbEVT_DEBUGGER_UPDATED
"sudo apt-get update", "sudo rpi-eeprom-update -a" and "sudo apt full-upgrade"  did not give anything.
Small warnings like:
Quote
libtool: warning: relinking 'libabbreviations.la'
...
libtool: warning: relinking 'libtodo.la'
...
were when installing the codeblocks however I don't think it's related.

Maybe the problem was in the installation of dependencies. How can this be verified?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: How to install codeblocks on raspberry pi 4?
« Reply #5 on: March 06, 2021, 04:13:43 pm »
This happens when you mix package based codeblocks and manual "make install" codeblocks. Remove one or the other or use "./configure --prefix=/somehting/different/from/default"
(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 MBajor

  • Single posting newcomer
  • *
  • Posts: 8
Re: How to install codeblocks on raspberry pi 4?
« Reply #6 on: March 06, 2021, 07:26:25 pm »
I apologise for my stupid question but could you explain me more precisely what and where I should delete.
I installed the codeblocks in a different folder than the default ("./configure --prefix=/opt/codeblocks-svn") but after trying to run the codeblocks I get the following window with an error message:
Quote
Cannot find resources...
Code::Blocks was configured to be installed in '/usr/local/share/codeblocks'.
Pleas use the command-line switch '--prefix' or set the CODEBLOCKS_DATA_DIR environment variable to point where Code::Blocks is installed, or try re-installing the application...
Thank you in advance for your help.

Offline cacb

  • Regular
  • ***
  • Posts: 487
Re: How to install codeblocks on raspberry pi 4?
« Reply #7 on: March 06, 2021, 08:49:39 pm »
Here is how I build Code::Blocks under Ubuntu, I guess it should work under PI4 as well

$ git clone https://github.com/obfuscated/codeblocks_sf
$ cd codeblocks_sf/
$ ./bootstrap
$ ./configure --with-contrib-plugins=all  --with-wx-config=/usr/bin/wx-config   --prefix=/ssd1/cb/
$ make
$ sudo make install


The value after --prefix is where the "make install" installs the binaries. Obviously a number of packages are required.

Another option you have (admittedly more work) is to cross compile from e.g. Ubuntu to PI4, see link in the Wiki http://wiki.codeblocks.org/index.php/Off-site_documentation


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: How to install codeblocks on raspberry pi 4?
« Reply #8 on: March 06, 2021, 09:50:05 pm »
MBajor:
Do you have any codeblocks related files outside of /opt/codeblocks-svn?
If you have and they are in a path that is searched before your current install path you'll have problems.
I'm talking specifically about library search paths.
(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 MBajor

  • Single posting newcomer
  • *
  • Posts: 8
Re: How to install codeblocks on raspberry pi 4?
« Reply #9 on: March 11, 2021, 06:40:26 pm »
cacb after the "./configure --with-contrib-plugins=all  --with-wx-config=/usr/bin/wx-config   --prefix=/ssd1/cb/" command I facing an error:
Quote
configure: error: Could not find a version of the library!
But the "./configure --with-contrib-plugins=all  --with-wx-config=/usr/bin/wx-config   --prefix=/ssd1/cb/" command really helped me a lot for wxSmith. Thank you!

oBFusCATed Eventually I decided to completely reinstall the operating system.
After reinstalling, I encountered a lot of errors:
error:
Quote
./bootstrap: 70: ./bootstrap: libtoolize: not found
Solution:
Quote
sudo apt-get install libtool
error:
Quote
configure.ac:141: warning: macro 'AM_OPTIONS_WXCONFIG' not found in library
configure.ac:142: warning: macro 'AM_PATH_WXCONFIG' not found in library
configure.ac:26: installing './compile'
configure.ac:22: installing './missing'
src/base/tinyxml/Makefile.am: installing './depcomp'
configure.ac:141: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:142: error: possibly undefined macro: AM_PATH_WXCONFIG
Solution first make command:
Quote
export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"
./bootstrap
error:
Quote
configure: error: Package requirements (hunspell) were not met:
No package 'hunspell' found
Solution:
Quote
sudo apt install libhunspell-dev
error:
Quote
configure: error: Package requirements (gamin) were not met:
No package 'gamin' found
Solution:
Quote
sudo apt-get install libgamin-dev libgamin0
error:
Quote
/bin/bash: zip: command not found
Solution:
Quote
sudo apt-get install zip
error:
Quote
fatal error: boost/spirit/include/classic.hpp: No such file or directory
#include <boost/spirit/include/classic.hpp>
Solution:
Quote
apt-get install libboost-all-dev
...
After this I successfully installed the svn codeblocks. But that's not exactly what I wanted. Because I wanted codeblocks 20.03. But attempt to build him give me an error which solution I can't find in internet.
Quote
/tmp/ccg9Nnhb.s: Assembler messages:
/tmp/ccg9Nnhb.s:938: Error: bad instruction `int3'
make[4]: *** [Makefile:597: dragscrollcfg.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory '/home/pi/Downloads/codeblocks-20.03/src/plugins/contrib/dragscroll'
make[3]: *** [Makefile:639: all-recursive] Error 1
make[3]: Leaving directory '/home/pi/Downloads/codeblocks-20.03/src/plugins/contrib'
make[2]: *** [Makefile:535: all-recursive] Error 1
make[2]: Leaving directory '/home/pi/Downloads/codeblocks-20.03/src/plugins'
make[1]: *** [Makefile:545: all-recursive] Error 1
make[1]: Leaving directory '/home/pi/Downloads/codeblocks-20.03/src'
make: *** [Makefile:676: all-recursive] Error 1
How exactly can I fix this error?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: How to install codeblocks on raspberry pi 4?
« Reply #10 on: March 11, 2021, 10:04:24 pm »
This last thing is fixed in trunk. I don't remember if we backported the fix to the 20.03 branch.
(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!]