Error while loading shared libraries: libwx_gtk3u_core-3.1.so.3: cannot open shared object file: No such file or directo

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
alvindera97
Earned a small fee
Earned a small fee
Posts: 20
Joined: Sun Apr 12, 2020 6:11 pm

Error while loading shared libraries: libwx_gtk3u_core-3.1.so.3: cannot open shared object file: No such file or directo

Post by alvindera97 » Wed Jul 29, 2020 11:56 am

I have a fresh install of Ubuntu 18.04.4LTS and wxWidgets 3.1.4. When I try executing the wxWidgets binary with

Code: Select all

./gpCalculator
, I get the error message:

Code: Select all

./gpCalculator: error while loading shared libraries: libwx_gtk3u_core-3.1.so.3: cannot open shared object file: No such file or directory
This is the result of

Code: Select all

ldd ./gpCalculator
:

Code: Select all

linux-vdso.so.1 (0x00007ffcabd9c000)
libwx_gtk3u_core-3.1.so.3 => not found
libwx_baseu-3.1.so.3[ => not found
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007faa0bf17000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007faa0bcff000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007faa0b90e000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007faa0b570000)
/lib64/ld-linux-x86-64.so.2 (0x00007faa0c524000)
I really don't know what to do as both files libwx_gtk3u_core-3.1.so.3 and libwx_baseu-3.1.so.3 are not found on my filesystem.

DavidHart
Site Admin
Site Admin
Posts: 3991
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Error while loading shared libraries: libwx_gtk3u_core-3.1.so.3: cannot open shared object file: No such file or dir

Post by DavidHart » Wed Jul 29, 2020 12:49 pm

Hi,

You need to explain more about what you are doing. In particular:
What is gpCalculator? Did you build it yourself? If so, did you build it on the same 18.04 install, against the same wxWidgets build?

Which wxWidgets build (or builds) is/are installed on your system? Where are they from? (self-builds?) Which is currently found in your $PATH? i.e. which is the selection if you do, in that terminal:
update-alternatives --display wx-config

My guess is that you are trying to run a binary built against wx3.1.3 libs, which you don't now have installed.

Regards,

David

alvindera97
Earned a small fee
Earned a small fee
Posts: 20
Joined: Sun Apr 12, 2020 6:11 pm

Re: Error while loading shared libraries: libwx_gtk3u_core-3.1.so.3: cannot open shared object file: No such file or dir

Post by alvindera97 » Wed Jul 29, 2020 1:03 pm

Yes you are right. On an older install of Ubuntu 18.04, I compiled the Grade Pending Calculator (binary — gpCalculator) with wxWidgets 3.1.3. I currently have wxWidgets 3.1.4 installed. Please how can I get wxWidgets 3.1.3 libraries installed? Is it even possible?

DavidHart
Site Admin
Site Admin
Posts: 3991
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Error while loading shared libraries: libwx_gtk3u_core-3.1.so.3: cannot open shared object file: No such file or dir

Post by DavidHart » Wed Jul 29, 2020 1:57 pm

Please how can I get wxWidgets 3.1.3 libraries installed?
Where did the older install's wx3.1.3 come from?
  • Did you build it yourself? If so, just get the source-code and build it in your current install.

alvindera97
Earned a small fee
Earned a small fee
Posts: 20
Joined: Sun Apr 12, 2020 6:11 pm

Re: Error while loading shared libraries: libwx_gtk3u_core-3.1.so.3: cannot open shared object file: No such file or dir

Post by alvindera97 » Wed Jul 29, 2020 2:12 pm

I downloaded the Linux/MacOS source (the file that ends in .tar.bz2). Then I followed the normal installation instructions A — Linux default — from here: https://wiki.wxwidgets.org/Compiling_an ... ng_started . I also want to ask, since I already have wxWidgets 3.1.4 installed and I want to get the libraries of wxWidgets 3.1.3, how would I have both 3.1.4 and 3.1.3 libraries? I also noticed that wxWidgets has no uninstall guide inwhich I can uninstall the version of wxWidgets that I have now and do a fresh install of wxWidgets [this time with informed config parameters].

Thanks.

DavidHart
Site Admin
Site Admin
Posts: 3991
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Error while loading shared libraries: libwx_gtk3u_core-3.1.so.3: cannot open shared object file: No such file or dir

Post by DavidHart » Wed Jul 29, 2020 2:32 pm

I also noticed that wxWidgets has no uninstall guide
The usual answer is to do, in the build dir:
sudo make uninstall
though IIRC it doesn't do much for wx installs. OTOH, for your problem, there's no great harm in leaving the 3.1.4 install there.
I want to get the libraries of wxWidgets 3.1.3, how would I have both 3.1.4 and 3.1.3 libraries
Again, in your situation, you should be able to do, with 3.1.3, exactly what you did to build and install 3.1.4.

A better answer (IMO) is to create 'local' builds. You would do in the 3.1.3 source dir, for example:

Code: Select all

mkdir build-dir && cd build-dir && \
../configure --with-gtk=3 --enable-debug  --enable-cxx11 --prefix=$(pwd) && \
make -j
There is no need to 'make install', just use the build where it is. To do that, you 'point' to its wx-config e.g. by prepending it to the $PATH of the terminal you'll be using:
PATH=/full/path/to/wx3.1.3/build-dir:$PATH

The great advantage of this is that multiple builds, of different types (gtk2/gtk3, debug/release, dynamic/static...) and different wx versions, can exist without interference.

Post Reply