Author Topic: wxSmith has a blackout!  (Read 7464 times)

Offline Danois

  • Multiple posting newcomer
  • *
  • Posts: 12
wxSmith has a blackout!
« on: September 19, 2026, 08:15:45 pm »
I am using C::B 25.03 from Kubuntu 26.04 (Wayland) repos. The first issue I had was the startup hanging which I temporarily fixed by renaming the wxSmith related zip's in "/usr/share/codeblocks". Since I have built Gdk-Pixbuf to version 2.42.12 and stored the libraries in "~/.local/lib" and used LD_LIBRARY_PATH to enable C::B to find those libraries. Now C::B starts as expected and there are no problems / errors when loading a wxSmith resources in the IDE, so I assume that wxSmith is (technically) working as it should. The issue is that whenever I load a resource, the wxFrame is displayed correctly for a brief moment whereafter the entire wxSmith area in the IDE goes black and stays like that.

Does anyone know a fix for this issue?

I have been looking at this build guide for building the entire C::B IDE from sources, but that looks.. Eherm.. Less palatable...... ;-)

Offline christo

  • Developer
  • Multiple posting newcomer
  • *****
  • Posts: 95
Re: wxSmith has a blackout!
« Reply #1 on: September 20, 2026, 05:05:49 am »
Hi Danois, could you please check if AppImage detailed in https://forums.codeblocks.org/index.php/topic,26313.msg178904.html#msg178904 works?

Offline Danois

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: wxSmith has a blackout!
« Reply #2 on: September 21, 2026, 07:27:09 pm »
Hi Danois, could you please check if AppImage detailed in https://forums.codeblocks.org/index.php/topic,26313.msg178904.html#msg178904 works?

I have tested the AppImage, and the issues I have mentioned in this topic are not present with the AppImage version. I have also been looking at the "real" build guide and I'm goint to try to build C::B from sources and see how it goes. If the build succeeds, I'm using that and if not I'll use the AppImage.

Thanks so far! :-)

Offline christo

  • Developer
  • Multiple posting newcomer
  • *****
  • Posts: 95
Re: wxSmith has a blackout!
« Reply #3 on: September 22, 2026, 03:58:44 am »
Please see the steps I use to build on my ubuntu 24.04, hope this is helpful for you

Code
#wxWidgets install
sudo apt install libwxgtk3.2-dev

#Alternatively wxWidgets build from source
git clone https://github.com/wxWidgets/wxWidgets.git
cd wxWidgets
git checkout v3.3.3
git submodule update --init
mkdir build-v3.3.3/
cd build-v3.3.3/
CC=/usr/local/bin/gcc-15.2.0 CPP=/usr/local/bin/cpp-15.2.0 CXX=/usr/local/bin/g++-15.2.0 ../configure --enable-xrc --enable-monolithic --enable-debug --enable-stc --enable-webview
make -j$(( $(nproc) - 1 ))
sudo make install

#install deps
sudo apt install libtool cmake

#Build C::B
cd ~/codeblocks-code
ACLOCAL_FLAGS="-I /usr/local/share/aclocal" ./bootstrap #ACLOCAL_FLAGS required only when installed wxwidgets from source
./configure --with-contrib-plugins=all --prefix=/opt/codeblocks/
make -j$(( $(nproc) - 1 )) install -k

Offline Danois

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: wxSmith has a blackout!
« Reply #4 on: September 24, 2026, 07:26:49 pm »
Thank you for your suggestion. I spun up a VM with a clean instance of Kubuntu 26.04 (I assume the following works for any *buntu), and this is what worked:

Code
#!/bin/bash
set -e

# Required packages
sudo apt update
sudo apt install -y build-essential libtool pkg-config libglib2.0-dev libgtk-3-dev libwxgtk3.2-dev subversion

# Get the source
cd "$(xdg-user-dir DOCUMENTS)"
svn checkout svn://svn.code.sf.net/p/codeblocks/code/trunk codeblocks-code
cd codeblocks-code

# Build & install
./bootstrap
./configure --with-contrib-plugins=all,-NassiShneiderman --prefix=/opt/codeblocks
make -j $(nproc)
sudo make install

# Desktop integration
mkdir -p ~/.local/share/applications
cat /opt/codeblocks/share/applications/codeblocks.desktop | \
  sed 's/^Exec=.*/Exec=\/opt\/codeblocks\/bin\/codeblocks \%F/' | \
  sed 's/^Icon=.*/Icon=application-x-codeblocks/' > ~/.local/share/applications/codeblocks.desktop

mkdir -p ~/.local/share/icons/hicolor/48x48/mimetypes
ln -s /opt/codeblocks/share/icons/hicolor/48x48/mimetypes/* ~/.local/share/icons/hicolor/48x48/mimetypes/

mkdir -p ~/.local/share/mime/packages
ln -s /opt/codeblocks/share/mime/packages/* ~/.local/share/mime/packages/

There are a couple of things, though.. Whilst running "configure .." i got an error that seemed to be related to a missing library (zlib), but after a lot of investigation I found out that the macro "PKG_CHECK_MODULES( .. )" was unavailable because the package "pkg-config" was not installed. I would suggest to either check for the presence of this package during bootstrap:

Code
# Test if pkg-config/pkgconf exists or else PKG_CHECK_MODULES(..) is not generated
if test -z "`which pkg-config`" && test -z "`which pkgconf`"; then
  echo "pkg-config or pkgconf is required. Aborting build..."
  exit 1
fi

The portability of this approach is unknown, though.. You could also use AC_CHECK_LIB in configure.ac instead:

Code
AC_CHECK_LIB([z], [compress2], [], [AC_MSG_ERROR([ZLib (libz) was not found!])])

Which is portable.

During the first launch of C::B, i created a new wxWidgets project and landed on wxSmith which took up all the space of the main window and from there I had to go to the View menu and show the "Manager" before I could find the headers / sources. If you are not familiar with C::B, that is not very intuitive and I would suggest that the Manager showing the "Projects" tab is always displayed when C::B is launched for the first time.

EDIT: I posted the wrong "bootstrap" snippet, "pkg-config --version" should have been "which pkg-config" which is corrected now.
« Last Edit: Yesterday at 11:40:38 am by Danois »

Offline christo

  • Developer
  • Multiple posting newcomer
  • *****
  • Posts: 95
Re: wxSmith has a blackout!
« Reply #5 on: Yesterday at 06:47:34 pm »
Change to fail configure with a clear error when pkg-config is unavailable is added to svn r14039

Offline Danois

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: wxSmith has a blackout!
« Reply #6 on: Yesterday at 07:37:27 pm »
Change to fail configure with a clear error when pkg-config is unavailable is added to svn r14039

Sounds great! Just mind that the macro may be provided from other packages, like "pkgconf" on Arch based systems. As far as I recall, the package must be available during bootstrap so user must re-run bootstrap or "autoreconf -if" if the package is installed after the initial bootstrap.

EDIT: I just looked at "configure" and it seems like the test is already present:

Code
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes

EDIT2: The package "pkg-config" is a placeholder which pulls in package "pkgconf" instead, both packages provide "/usr/bin/pkg-config", so no need to check for multiple packages.
« Last Edit: Yesterday at 08:28:32 pm by Danois »