menu

Questions & Answers

why ruuning gtk4 app on ubuntu 20 gives while loading shared libraries: libgtk-4.so.1: cannot open shared object file: No such file or directory?

I'm new to linux. Is it poosible to use GTK4 developed apps in older version like ubutnu 16,18 etc.

Tried executing a compiled (ubutnut 22)Gtk4 binary into ubuntu 20.

And got...

/hello: error while loading shared libraries: libgtk-4.so.1: cannot open shared object file: No such file or directory

Answers(1) :

ldd gtk4_app_name Find out what dynamic libraries are being linked to your GTK4 app. Share more information on your files, pwd what directory name. echo $PATH

https://linuxhint.com/use-ldd-command-in-linux/ https://manpages.ubuntu.com/manpages/trusty/man1/ldd.1.html

readelf -s gtk4_app_name ls -l

the gtk4 app is using a newer version of the library. Install a newer version of the library to replace the old library.
su root password: cd /lib ln -s libgtk-3.so.1 libgtk-4.so.1 # check on the order Create ln -s TARGET LINKNAME Symbolic Link from newer version name libgtk-4.so.1 to older presently existing library name /lib/libgtk-3.so.1 In the 1st form, create a link to TARGET with the name LINK_NAME.

https://manpages.ubuntu.com/manpages/focal/en/man1/ln.1.html

Realize the mixing and matching library names is BAD POLICY. Better to update applications to match libraries so you don't create random runtime problems. Open a terminal, read the manual details on symbolic linking man ln https://manpages.ubuntu.com/manpages/focal/en/man7/symlink.7.html

https://www.cyberciti.biz/faq/ubuntu-upgrade-update-single-package-using-apt-get/In the 1st form, create a link to TARGET with the name LINK_NAME. https://linuxhint.com/update_all_packages_ubuntu/ https://tecadmin.net/upgrading-ubuntu-packages-command-line/

You asked a question. I answered based on your given information. Please share back what worked or what did not work for you. Have a great day. Learn linux and share with others in your neighborhood.

I use ghostbsd.org ghostbsd.org/download latest Best of luck to you. We all learn something new, even after 40 years. Fred