简体   繁体   中英

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

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

I get the error message:
./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 output of ldd./gpCalculator below :

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)

Any suggestion or help would be really appreciated. It's a school project. The gitub repo is https://github.com/alvindera97/Engineering-Grade-Pending-C- if you would like to gain access to the binary itself and the source code.

Thank you in anticipation!

You have to install those libraries.

The error says are missing (can't be found.)

libwx_gtk3u_core-3.1.so.3 => not found
libwx_baseu-3.1.so.3 => not found

Install command:

apt-get install libwxgtk-webview3.0-gtk3-0v5 libwxgtk-media3.0-gtk3-0v5

If you want to know which package provides a file, you can install and update (as root):

root@desktop:~# apt-get install apt-file
root@desktop:~# apt-file update

And find:

manuel@desktop:~/projects$ apt-file find wx_gtk3u

libwxgtk-media3.0-gtk3-0v5: /usr/lib/x86_64-linux-gnu/libwx_gtk3u_media-3.0.so.0
libwxgtk-media3.0-gtk3-0v5: /usr/lib/x86_64-linux-gnu/libwx_gtk3u_media-3.0.so.0.4.0
libwxgtk-media3.0-gtk3-dev: /usr/lib/x86_64-linux-gnu/libwx_gtk3u_media-3.0.so
libwxgtk-webview3.0-gtk3-0v5: /usr/lib/x86_64-linux-gnu/libwx_gtk3u_webview-3.0.so.0
libwxgtk-webview3.0-gtk3-0v5: /usr/lib/x86_64-linux-gnu/libwx_gtk3u_webview-3.0.so.0.4.0
libwxgtk-webview3.0-gtk3-dev: /usr/lib/x86_64-linux-gnu/libwx_gtk3u_webview-3.0.so

Which gives you the packages: libwxgtk-media3.0-gtk3-0v5 , libwxgtk-webview3.0-gtk3-dev in which that name appears.

If you are working with a compiled binary (a program) you have to install the libraries that were used to compile that program in the original linux install (same version or, often, more modern.)

If you can't install those, with Linux, at least, you can compile all from source: libs, program, etc...

(Explanations after some comments.)

In fact, you are working with the compiled program, and I have the exact same output:

 
manuel@desktop:~/projects/Engineering-Grade-Pending-C- (master)$ ./gpCalculator 
./gpCalculator: error while loading shared libraries: libwx_gtk3u_core-3.1.so.3: cannot open shared object file: No such file or directory

Checking out the repo gives:

manuel@desktop:~/projects/Engineering-Grade-Pending-C- (master)$ l
total 8,1M
-rw-r--r-- 1 manuel manuel 230K jul 29 23:10 gp_and_cgpa_calculator.cpp
-rwxr-xr-x 1 manuel manuel 597K jul 29 23:10 gpCalculator*
-rw-r--r-- 1 manuel manuel 7,3M jul 29 23:10 gpCalculator.exe
-rw-r--r-- 1 manuel manuel 1,2K jul 29 23:10 README.md

were gpCalculator is the executable that can't find the libraries.

The problem, isn't in the compiling or distribution, the problem is that you never should run software from a source you don't know and trust. If you want to run this, just get the source, compile and use it.

This gpCalculator executable could be just sending all your hard drive information to anyone.

That being said, to run that program you just have to do what I said: install the missing libraries or compile and install all of them. (Don't need to distribute anything .)

@Manuel

Hi,

You don't have to compile and install the libraries that the program was built with.

When you said that you compiled wxWidgets 3.1.4, does this mean you ran:

configure <set_of_options>
make
make install
ldconfig

or you just ran:

configure
make

Now, all different Linux distribution (and Unix ones) have their own repositories. Every *nix distribution have their own way of getting the packages from said distribution. Every *nix distribution works differently with the packages on marking them stable inside this distribution in order for the users to do the upgrades.

So for the developers "it is a nightmare" to create different ways to distribute the application on *nix. Therefore *nix developers can create a distribution scripts and/or ask *nix maintainers to include their software in the repository.

That way the distribution script will take care of every dependency the program have. The script will also take care of the needing to upgrade the required library to the newer version - the maintainers of those libraries will have to recompile your software, make sure it works as intended, mark it stable and be done with it. Then they will update the distribution script appropriately.

In the end - it is not your task to distribute on *nix, it is a task of the distribution maintainers to write/update such a distribution script. Or write a proper documentation/example so that you can do it and submit to the distribution maintainers to include it inside their package tree.

I hope it is more clear now.

[EDIT]

Quoting one of your responces from the previous answer:

At this point, I don't know if it would still be possible to run the same app. Since I have the source code and an install of wxWidgets, I was able to recompile the binary into a new file and run the program, The source code was written and compiled with wxWidgets3.1.3 however I have wxWidgets3.1.4 installed and I am not trying to recompile. I am only trying to run the binary. If I wanted to run this program on another linux install, does this mean that I have to reinstall wxWidgets and recompile the program? I am really perplexed. Thank you

[/EDIT]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM