Author Topic: Debian package error with wxWidgets 3.2 - Need help  (Read 5737 times)

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Debian package error with wxWidgets 3.2 - Need help
« on: July 13, 2022, 08:00:31 am »
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:

Code
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....

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1628
Re: Debian package error with wxWidgets 3.2 - Need help
« Reply #1 on: July 13, 2022, 01:46:57 pm »
I know nothing about Debian package creation, but this
Code
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.

Offline blauzahn

  • Almost regular
  • **
  • Posts: 179
Re: Debian package error with wxWidgets 3.2 - Need help
« Reply #2 on: July 13, 2022, 04:23:00 pm »
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:

Code
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.


Offline blauzahn

  • Almost regular
  • **
  • Posts: 179
Re: Debian package error with wxWidgets 3.2 - Need help
« Reply #3 on: July 13, 2022, 04:36:31 pm »
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:
Code
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:
Code
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)

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: Debian package error with wxWidgets 3.2 - Need help
« Reply #4 on: July 14, 2022, 09:14:56 am »
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 :
Code
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:
Code
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:
Code
./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?

Offline blauzahn

  • Almost regular
  • **
  • Posts: 179
Re: Debian package error with wxWidgets 3.2 - Need help
« Reply #5 on: July 14, 2022, 08:53:14 pm »
Code
warning: cannot find library libcodeblocks.so needed by debian/codeblocks/usr/lib/codeblocks/plugins/libabbreviations.so

Code
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.

Code
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:

Code
$ 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:

Code
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:
Code
$ 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

Code
$ ldd /usr/local/lib/codeblocks/plugins/libabbreviations.so |grep libcodeb
libcodeblocks.so.0 => /usr/local/lib/libcodeblocks.so.0 (0x00007f5560a00000)

Code
$ 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?

Offline blauzahn

  • Almost regular
  • **
  • Posts: 179
Re: Debian package error with wxWidgets 3.2 - Need help
« Reply #6 on: July 14, 2022, 09:00:19 pm »
Forgot to mention: I use ubuntu 20.04. Do you have installed some related stuff on your ubuntu 22.04 with snap?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7670
    • My Best Post
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 AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 678
Re: Debian package error with wxWidgets 3.2 - Need help
« Reply #8 on: July 15, 2022, 09:03:25 am »
I will get back to the C::B debian builds early next week and post how I go.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7670
    • My Best Post
Re: Debian package error with wxWidgets 3.2 - Need help
« Reply #9 on: July 15, 2022, 04:12:20 pm »
This might help https://docs.codelite.org/wxWidgets/repo320/#ubuntu-and-debian

Edit: It has been a few years since I last did Linux.
« Last Edit: July 15, 2022, 04:14:08 pm by stahta01 »
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