We have an application that was originally developed about 10 years ago, based on wxWidgets version 2.8, running under Debian 6 on a 32-bit platform. Nearly 5 years ago, shortly after I joined the company, we moved to a 64-bit platform, running Debian 8.3, and updated to wxWidgets version 3.0.2.
We have now decided it is time to produce a version of our application to run under Debian 10.
I have done the following:
- downloaded the sources for wxWidgets v3.0.5
- extracted the files into my home folder, in the sub-directory "wx", so the path is $home/wx/wxWidgets-3.0.5
- created a build sub-directory within the wxWidgets-3.0.5 directory, namely wxbld
- from wxbld, I ran:
../configure --enable-unicode
make
make install
cd samples
make
All of these built successfully, and I was able to run the samples successfully.
I then tried building our application from within the Eclipse IDE.
The compiler settings include: `wx-config --cxxflags` -O3 -Wall
The linker settings include: ``wx-config --libs --unicode=yes` `wx-config --gl-libs`
The application built successfully. When I tried to run it, however, I got the following error:
: error while loading shared libraries: libwx_gtk3u_xrc-3.0.so.0: cannot open shared object file: No such file or directory
I have checked that the libraries are present in /usr/local/lib and that they all have executable privilege. And I therefore mystified as to what could be wrong, although presumably there must be a fundamental difference in my build settings in comparison with those of the samples. Or maybe the samples don’t actually use the shared libraries?
Any clues gratefully received!
Error loading wxWidgets shared libraries on Debian 10
-
- Knows some wx things
- Posts: 37
- Joined: Thu Jul 28, 2016 9:09 am
Re: Error loading wxWidgets shared libraries on Debian 10
Hi,
Regards,
David
There was a change to wx-config in wx3. You now need e.g. `wx-config --libs std,xrc`.The application built successfully. When I tried to run it, however, I got the following error:
: error while loading shared libraries: libwx_gtk3u_xrc-3.0.so.0: cannot open shared object file: No such file or directory
The samples get correctly configured when you build the wx source.Or maybe the samples don’t actually use the shared libraries?
Regards,
David
-
- Knows some wx things
- Posts: 37
- Joined: Thu Jul 28, 2016 9:09 am
Re: Error loading wxWidgets shared libraries on Debian 10
Unfortunately changing the linker options to use `wx-config --libs std,xrc` didn't work, and neither did `wx-config --libs all`. In a way, that wasn't particularly surprising, because I was already building my application successfully with wxWidgets 3 on Debian 8.
Instead, it turned out that the problem was with ldconfig. I resolved the issue by running (as the superuser):
/sbin/ldconfig -v
I got this tip from the following page on the web:
https://itsfoss.com/solve-open-shared-o ... quick-tip/
Thanks very much for the rapid assistance, nevertheless!
Instead, it turned out that the problem was with ldconfig. I resolved the issue by running (as the superuser):
/sbin/ldconfig -v
I got this tip from the following page on the web:
https://itsfoss.com/solve-open-shared-o ... quick-tip/
Thanks very much for the rapid assistance, nevertheless!
Re: Error loading wxWidgets shared libraries on Debian 10
Hi,
Out of curiosity - is there areason you use -O3 when building?
It is known to cause problems...
Thank you.
Out of curiosity - is there areason you use -O3 when building?
It is known to cause problems...
Thank you.
Re: Error loading wxWidgets shared libraries on Debian 10
@Tim,
Still -O3 loks a little weird...
Thank you.
Still -O3 loks a little weird...
Thank you.
-
- Knows some wx things
- Posts: 37
- Joined: Thu Jul 28, 2016 9:09 am
Re: Error loading wxWidgets shared libraries on Debian 10
Hi,
The best option is usually -O2 (or -Os to optimize for speed).
But you need to recompile wxWidgets and any other library you are using with new optimization option. And then your application.
Thank you.
The best option is usually -O2 (or -Os to optimize for speed).
But you need to recompile wxWidgets and any other library you are using with new optimization option. And then your application.
Thank you.
-
- Knows some wx things
- Posts: 37
- Joined: Thu Jul 28, 2016 9:09 am
Re: Error loading wxWidgets shared libraries on Debian 10
Just to confirm, I got rid of the -O3 optimisation, and the application seems to run satisfactorily with -O1.
One other build setting I found I had to make (and thus might help someone if I mention) was to link with -no-pie, because otherwise the Nautilus Explorer won't launch the application when one double-clicks on it.
One other build setting I found I had to make (and thus might help someone if I mention) was to link with -no-pie, because otherwise the Nautilus Explorer won't launch the application when one double-clicks on it.