User forums > Using Code::Blocks
Huge problem with Code::Blocks installation
codeks:
Hi. First of all I would like to say I visited this and many other forums to try and fix this issue, to no avail.
Recently I updated my whole system to the newest software. That includes wxWidgets, codeblocks etc.
The problem is that I use real time charting tool called wxFreeChart which has long but abandoned support.
wxFreeChart uses gtk2 so I was forced to install wxWidgets with gtk2 as well(tried both versions 2.8.12 and 3.0.5 of wxWidgets with gtk2).
I have ran into difficulties using the 20.03 codeblocks version with gtk2 so I tried version 17.12-1 which didn't let me install it's .deb files.
Now I am trying to use Code::Blocks version 16.01-release with wxWidgets version 3.0.5 with gtk2. I installed wxWidgets like so:
--- Code: ---../configure --with-gtk=2 --enable-monolithic
make -j4
sudo make install
sudo ldconfig
--- End code ---
Then I tried installing Code::Blocks 16.01 like this:
--- Code: ---export CXXFLAGS="-std=c++11"
export ACLOCAL_FLAGS="-I `wx-config --prefix`/share/aclocal"
./bootstrap
./configure --prefix=/usr --with-contrib-plugins=all,-help
make
--- End code ---
"make" gives me and error ./sdk_common.h:37:10: fatal error: wx/wxprec.h: No such file or directory
I should note I do have wxprec.h under /usr/include/wx-3.0/wx
--- Code: ---wx-config --version
--- End code ---
shows:
--- Code: ---3.0.5
--- End code ---
and,
--- Code: ---wx-config --list
--- End code ---
shows:
--- Code: ---Default config is gtk2-unicode-3.0
Default config will be used for output
Alternate matches:
gtk3-unicode-3.1
gtk3-unicode-static-3.1
Also available in /usr/local:
gtk2-unicode-release-2.8
--- End code ---
In summary: I'm trying to build and install Code::Blocks with gtk2 so my system could work with older software(wxFreeCharts) but am unable to compile from source.
oBFusCATed:
1. you can have multiple versions of wx installed
2. you can use one for cb and another for your software
3. there is a flag to give the correct wx-config executable to configure... Try ./configure --help...
4. never use the default prefix of /usr/local. It is a disaster waiting to happen.
cacb:
--- Quote from: codeks on July 14, 2021, 04:32:26 pm ---wxFreeChart uses gtk2 so I was forced to install wxWidgets with gtk2 as well(tried both versions 2.8.12 and 3.0.5 of wxWidgets with gtk2).
--- End quote ---
I have built code using wxFreeChart for a number of years using my own project file. It works with wx3. I don't think it depends on gtk2 either, not 100% sure.
As oBFusCATed said, there is no requirement to use the same wxWidgets version for building C::B and your own software. They can be different.
codeks:
Thank you for the replies.
--- Quote from: oBFusCATed on July 14, 2021, 04:45:32 pm ---1. you can have multiple versions of wx installed
2. you can use one for cb and another for your software
3. there is a flag to give the correct wx-config executable to configure... Try ./configure --help...
4. never use the default prefix of /usr/local. It is a disaster waiting to happen.
--- End quote ---
I used --prefix=/usr when configuring wxWidgets and it installed wxprec.h in /usr/include/wx-3.0/wx instead of /usr/local/ but when building codeblocks I still get:
--- Code: ---./sdk_common.h:37:10: fatal error: wx/wxprec.h: No such file or directory
--- End code ---
--- Quote from: cacb on July 14, 2021, 05:33:03 pm ---I have built code using wxFreeChart for a number of years using my own project file. It works with wx3. I don't think it depends on gtk2 either, not 100% sure.
As oBFusCATed said, there is no requirement to use the same wxWidgets version for building C::B and your own software. They can be different.
--- End quote ---
wxFreeChart doesn't work with GTK3, I've tried already.
How can I use a different version for my software if I'm using C::B to build it? Sorry for my ignorance, first time doing something like this.
cacb:
--- Quote from: codeks on July 14, 2021, 05:58:10 pm ---How can I use a different version for my software if I'm using C::B to build it? Sorry for my ignorance, first time doing something like this.
--- End quote ---
Code::Blocks and your software are entirely independent (or should be). When you build C::B you select a wxWidgets configuration, because C::B uses wxWidgets in its implementation, but you can have more than one wxWidgets version installed. For example, here is the script I use for building C::B inder ubuntu
https://github.com/arnholm/cpde_3rdparty/blob/master/gcc/codeblocks/build_cb.sh
But I use another wxWidgets build for my own software, installed elsewhere, no problem. You just have to configure your C::B projects to reference the correct wx version for your software. I use global variables for that, but it is not a requirement.
Navigation
[0] Message Index
[#] Next page
Go to full version