I have been able to build & run C::B on Linux (Xubuntu 22.04)with wxWidgets 3.2 using the following methods:
- C::B loading workspace
- boostrap/configure/make
I have not been able to build C::B on Linux (Xubuntu 22.04) with wxWidgets 3.2 using the debian build process. I get the following failure:
dh_shlibdeps -pcodeblocks
dpkg-shlibdeps: warning: cannot find library libcodeblocks.so needed by debian/codeblocks/usr/lib/codeblocks/plugins/libdefaultmimehandler.so (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '')
dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libwx_gtk3u_xrc-3.2.so.0 (used by debian/codeblocks/usr/lib/codeblocks/plugins/libdefaultmimehandler.so)
Hint: check if the library actually comes from a package.
dh_shlibdeps: error: dpkg-shlibdeps -Tdebian/codeblocks.substvars debian/codeblocks/usr/lib/codeblocks/plugins/libprojectsimporter.so debian/codeblocks/usr/lib/codeblocks/plugins/libabbreviations.so debian/codeblocks/usr/lib/codeblocks/plugins/libAstyle.so debian/codeblocks/usr/lib/codeblocks/plugins/libclangd_client.so debian/codeblocks/usr/lib/codeblocks/plugins/liboccurrenceshighlighting.so debian/codeblocks/usr/lib/codeblocks/plugins/libautosave.so debian/codeblocks/usr/lib/codeblocks/plugins/libcompiler.so debian/codeblocks/usr/lib/codeblocks/plugins/libscriptedwizard.so debian/codeblocks/usr/lib/codeblocks/plugins/libopenfileslist.so debian/codeblocks/usr/lib/codeblocks/plugins/libdefaultmimehandler.so debian/codeblocks/usr/lib/codeblocks/plugins/libdebugger.so debian/codeblocks/usr/lib/codeblocks/plugins/libtodo.so debian/codeblocks/usr/lib/codeblocks/plugins/libclasswizard.so debian/codeblocks/usr/bin/cb_share_config debian/codeblocks/usr/bin/codeblocks debian/codeblocks/usr/bin/cb_console_runner returned exit code 2
dh_shlibdeps: error: Aborting due to earlier error
make: *** [/usr/share/cdbs/1/rules/debhelper.mk:338: binary-predeb-IMPL/codeblocks] Error 25
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2
Anyone got any ideas or pointers as I find the "dpkg-buildpackage -us -uc" build step not nice to trouble shoot. I built wxWidgets 3.2.0 locally and installed it, so I may not have done the install correctly in that I "just" ran "make install".
BTW the "dpkg-buildpackage -us -uc" build step does not work on WSL2, so if you know how to get it to work can you please let me know then I can do the builds in WSL2 instead of on a virtual machine....
I know nothing about Debian package creation, but this
Hint: check if the library actually comes from a package.
suggests you need to install wxWidgets 3.2 using a package, not compiling it yourself.
wxWidgets 3.2 is a stable version, so I hope Debian and Ubuntu will soon make packages to replace the current wx3.0 ones.
On my local ubuntu machines I also compile wxwidgets trunk regularly via bootstrap/configure/make and install it via a comparably simplistic target in my Makefile:
checkinstall:
checkinstall --pkgname=wxwidgets_trunk --default $(MAKE) install
This is not the canonical (pun not intended) debian way but at least I get a dpkg which is uninstalled cleanly when I rerun this the next time.
I also do this with cb itself as well as with other programs like cppcheck.
In order for the installation, mentioned in my previous post, to work properly, wxwidgets and cb have to be configured accordingly. I install wxwidgets in /opt, so that it does not collide with the wxwidgets version coming with ubuntu. This is quite primitive but I have used it for years and still use it to this day.
For wxwidgets:
BUILD=build
TRUNK=trunk
WX_PREFIX=/opt/wx
config:
-mkdir -p $(BUILD)
(cd $(BUILD) && ../$(TRUNK)/configure --prefix=$(WX_PREFIX) --with-cxx=14)
# --enable-stl triggers compile-problem in codeblocks
# see: http://forums.codeblocks.org/index.php/topic,21763.msg148002.html#msg148002
install:
mkdir -p $(WX_PREFIX)
(cd $(BUILD) && $(MAKE) install)
echo $(WX_PREFIX)/lib >/etc/ld.so.conf.d/wxwidgets.conf
ldconfig
and cb:
PREFIX=/usr/local
WX_PREFIX=/opt/wx
build=build
trunk=trunk
config:
@mkdir -p $(build)
(cd $(build) && \
LT_SYS_LIBRARY_PATH=$(WX_PREFIX)/lib \
CC=${CC} CXX=${CXX} ../$(trunk)/configure \
--prefix=$(PREFIX) \
--with-wx-config=$(WX_PREFIX)/bin/wx-config --with-wx-prefix=$(WX_PREFIX) \
--disable-code-completion \
--with-contrib-plugins=all,-NassiShneiderman)
Thanks for the posts.
The checkinstall worked and created the deb package and installed it so the files are part of the packages (verified via "dpkg -S <filename>" commands).
After updating the wxWidget build to install in /opt/wx I get the same error, but the error now referencing the /opt/wx/lib files :
dpkg-shlibdeps: warning: cannot find library libcodeblocks.so needed by debian/codeblocks/usr/lib/codeblocks/plugins/libabbreviations.so (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '')
dpkg-shlibdeps: error: no dependency information found for /opt/wx/lib/libwx_gtk3u_xrc-3.2.so.0 (used by debian/codeblocks/usr/lib/codeblocks/plugins/libabbreviations.so)
Hint: check if the library actually comes from a package.
dh_shlibdeps: error: dpkg-shlibdeps -Tdebian/codeblocks.substvars -l/opt/wx/lib debian/codeblocks/usr/lib/codeblocks/plugins/libprojectsimporter.so debian/codeblocks/usr/lib/codeblocks/plugins/libabbreviations.so debian/codeblocks/usr/lib/codeblocks/plugins/libAstyle.so debian/codeblocks/usr/lib/codeblocks/plugins/libclangd_client.so debian/codeblocks/usr/lib/codeblocks/plugins/liboccurrenceshighlighting.so debian/codeblocks/usr/lib/codeblocks/plugins/libautosave.so debian/codeblocks/usr/lib/codeblocks/plugins/libcompiler.so debian/codeblocks/usr/lib/codeblocks/plugins/libscriptedwizard.so debian/codeblocks/usr/lib/codeblocks/plugins/libopenfileslist.so debian/codeblocks/usr/lib/codeblocks/plugins/libdefaultmimehandler.so debian/codeblocks/usr/lib/codeblocks/plugins/libdebugger.so debian/codeblocks/usr/lib/codeblocks/plugins/libtodo.so debian/codeblocks/usr/lib/codeblocks/plugins/libclasswizard.so debian/codeblocks/usr/bin/cb_share_config debian/codeblocks/usr/bin/codeblocks debian/codeblocks/usr/bin/cb_console_runner returned exit code 2
dh_shlibdeps: error: Aborting due to earlier error
I the /opt/wx/lib/libwx_gtk3u_xrc-3.2.so.0 is part of the wxwidgetstrunk package as per the following:ubuntu@Ubuntu2204:~/Code/CodeBLocks_Private_Experimental_GCC$ dpkg -S /opt/wx/lib/libwx_gtk3u_xrc-3.2.so.0
wxwidgetstrunk: /opt/wx/lib/libwx_gtk3u_xrc-3.2.so.0
The debian build process uses the following commands:
./update_revision.sh
./bootstrap
./debian/setup_control.sh
dpkg-buildpackage -us -uc
The boostrap/configure/make process works.
The wx-config is configured for wxWidgets 3.2.0.
Any more ideas?
warning: cannot find library libcodeblocks.so needed by debian/codeblocks/usr/lib/codeblocks/plugins/libabbreviations.so
error: no dependency information found for /opt/wx/lib/libwx_gtk3u_xrc-3.2.so.0 (used by debian/codeblocks/usr/lib/codeblocks/plugins/libabbreviations.so)
It looks like you get this error during installation of wxwidgets, right? I have not seen this particular error. Sounds like a checken-and-egg-problem.
Do you still have some stale files from a previous blunt make install lying around? In my Makefile in the directory above trunk the install target nukes at least the share and lib directories of cb from the previous install prior installing it again. That normally does the trick.
install:
-@if [ -d $(PREFIX)/share/codeblocks ]; then rm -rf $(PREFIX)/share/codeblocks; fi
-@if [ -d $(PREFIX)/lib/codeblocks ]; then rm -rf $(PREFIX)/lib/codeblocks; fi
(cd $(build) && $(MAKE) install)
mkdir -p $(PREFIX)/share/codeblocks/locale/de_DE
install -m 644 de_codeblocks.mo $(PREFIX)/share/codeblocks/locale/de_DE/de_codeblocks.mo
On arch, I still use that unsafe way without involving the package manager pacman. I know, I should use it.
And I move the whole (out-of-tree) build directory away into build.old.
My daily build command line for wxwidgtes as for cb, conviently recalled by Ctrl-r, looks like this:
$ rm -rf build.old; mv build build.old; make bootstrap && make config && time make -j 16
In the Makefile above wxwidgets' trunk directory, bootstrap is an empty target. In cb it looks like:
bootstrap:
(cd $(trunk) && ACLOCAL_FLAGS="-I `$(WX_PREFIX)/bin/wx-config --prefix`/share/aclocal" ./bootstrap )
It does not hurt if you call it again.
Did you recompile codeblocks after you recompiled and installed wxwidgets? When I start cb after having recompiled wxwidgets sometimes I get an unresolved reference. Looks like wxwidgets trunk is not always ABI compatible but rather API compatible. This should surprise anybody who is willing to use trunk prior release. Recompiling and reinstalling cb usually helps in these cases. The only occation when it did not was with wxwidgets recent change with wxBitmapBundle.
I assume, you created a file /etc/ld.so.conf.d/wxwidgets.conf which includes /opt/wx/lib. And that you called ldconfig afterwards.
asking ldd I get:
$ ldd /usr/local/lib/codeblocks/plugins/libabbreviations.so |grep libwx_gtk3u_xrc
libwx_gtk3u_xrc-3.2.so.0 => /opt/wx/lib/libwx_gtk3u_xrc-3.2.so.0 (0x00007f367be55000)
and
$ ldd /usr/local/lib/codeblocks/plugins/libabbreviations.so |grep libcodeb
libcodeblocks.so.0 => /usr/local/lib/libcodeblocks.so.0 (0x00007f5560a00000)
$ dpkg -S /opt/wx/lib/libwx_gtk3u_xrc-3.2.so.0
wxwidgets-trunk: /opt/wx/lib/libwx_gtk3u_xrc-3.2.so.0
I named the package wxwidgets-trunk with a minus sign in between.
Does it help you?