gtk

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

Ask Question

Asked 1 month ago

Active 1 month ago

Viewed 114 times

 

0

 

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!

c++ linux wxwidgets

share  follow 

asked Jul 29 at 10:07

 

Alvindera97

555 bronze badges

add a comment

2 Answers

ActiveOldestVotes

0

 

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-0v5libwxgtk-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.)

share  follow 

edited Jul 29 at 21:23

answered Jul 29 at 11:24

 

Manuel

2,02311 gold badge1010 silver badges1515 bronze badges

  • This is the reply I got from the terminal: E: Unable to locate package libwx_gtk3u_core E: Unable to locate package libwx_gtk3u_core – Alvindera97 Jul 29 at 11:40 

  • @Alvindera97 yes, sorry, wrong lib names. Put your version numbers anyway, I work with an old system. – Manuel Jul 29 at 11:46

  • I tried running the command you added to the answer apt-get install libwxgtk-webview3.0-gtk3-0v5 libwxgtk-media3.0-gtk3-0v5 and I still got the same 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. I'm not sure how I'll be able to properly guess the version numbers, however, I have a wxWidgets install of version 3.1.4.... – Alvindera97 Jul 29 at 11:51 

  • @Alvindera97 version numbers, I've put an example, your version numbers are different. – Manuel Jul 29 at 11:53

  • Thank you so much. I'm working on it now. I'll get back to you as soon as it's done – Alvindera97 Jul 29 at 12:02

show 5 more comments

 

0

 

@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]

share  follow 

edited Jul 29 at 21:29

answered Jul 29 at 17:12

Igor

3,83888 gold badges3535 silver badges7171 bronze badges

  • 1) I've never said that "have to compile and install the libraries that the program was built with". I've said just install; and it those (versions) aren't there, you can always compile them. 2) I've never said I compiled anything. 2) OP is not asking for all different Linux distribution (and Unix ones), but just for Ubuntu 18.04.4LTS and wxWidgets 3.1.4. 3) We weren't talking about distributing software, but about using the correct version. It is a Github repo. – Manuel Jul 29 at 20:52

  • To add to the previous comment, I have to say that the original repo doesn't have any information about dependencies or version numbers. It only says All code was written with the Linux operating system, specifically Ubuntu 18.04.04 but didn't say if libraries were changed (versions.) So the "it is not your task to distribute on _nix" statement you say, just doesn't make sense. OP is following someone code/program that hasn't any kind of quality and by not means is ready to distribute. I've just given some advice to work with that software. – Manuel Jul 29 at 21:05

  • @Manuel, To answer to your points: 1. Yes - that's correct. However you need to know what version the program was built with in order to install them in the first place. 2. No true - see the edit. 3. OK, but in order to produce the binary that will run successfully you need to compile proper version of the wxWidgets, right? And it should be given either in the README.md or in the documentation. Which I agree is incorrect. And as you successfully point out the author of the repository should have taken care of providing a good version or instruct how to upgrade the version. – Igor Jul 29 at 21:35

  • Pardon me for the late reply. I am a python guy and this was my first work with C++ so I understand that the code quality is poor. I compiled the code to produce the binary gpCalculator with wxWidgets 3.1.3. Now I have a new install of ubuntu 18.04, I have wxWidgets 3.1.4 installed and I couldn't run the binary. This is the point where I started this question. – Alvindera97 Jul 30 at 23:09 

  • After a bit more question asking on wxWidgets foum: forums.wxwidgets.org/… , it was explained to me that I could run the binary after I have downloaded wxWidgets source code [the version inwhich the app was built] and built the source [and I apparently don't have to do a make install] everything should work...... If I knew about shared in detail, I would most probably not have built wxWidgets with the 'allow-shared-libraries' flag. Yes the application's size would increase, however, no need for extra configuration to get the app to work – Alvindera97 Jul 30 at 23:16 

show 2 more comments

Your Answer

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值