Pavel_47
Posts: 42
Joined: Mon Jun 12, 2017 8:34 am
Location: Switzerland

Missing sharing libraries

Fri Apr 12, 2019 12:47 pm

Hello,
While executing Qt-based program, I get the following error:
error while loading shared libraries: libGLESv2.so.2: cannot open shared object file: No such file or directory.
Thnks in advance.

User avatar
topguy
Posts: 5569
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Missing sharing libraries

Fri Apr 12, 2019 2:15 pm

It is relevant if this application was built with the standard Qt installation on Pi or not.
...but you can try this:

Code: Select all

export LD_LIBRARY_PATH=/opt/vc/lib
You do this in the shell before trying to start the Qt application.

You should also check if the file exists in the "/opt/vc/lib" directory. You might only have "libbrcmGLESv2.so" so you might have to make a symbolic link with the name reported as missing.

Code: Select all

ln -s /opt/vc/lib/libbrcmGLESv2.so /opt/vc/lib/libGLESv2.so.2

Pavel_47
Posts: 42
Joined: Mon Jun 12, 2017 8:34 am
Location: Switzerland

Re: Missing sharing libraries

Fri Apr 12, 2019 2:42 pm

Thanks,

export didn't help.

Probably I need to tell whole story.
First, Qt-based application worked partionally: radio-button didn't work properly.
Moreover, when application launched, the foollowing message appeared:

(1) libEGL warning: DRI2: failed to authenticate
(2) QMetaObject::connectSlotsByName: No matching signal for on_radioButton_togleed(bool)
inotify_add_watch("home/pi/.config/qt5ct") failed. "No such file or directory"


Loooking for a solution for (1) I've found (certainly erroneously) this remedy:
https://pi3d.github.io/html/FAQ.html

Code: Select all

$ sudo ln -fs /opt/vc/lib/libEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so
$ sudo ln -fs /opt/vc/lib/libEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1
$ sudo ln -fs /opt/vc/lib/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so
$ sudo ln -fs /opt/vc/lib/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2
After applying these commands Qt-based application doesn't start ... and above-mentionned error announcing abscence of libGLESv2.so library appears

swampdog
Posts: 197
Joined: Fri Dec 04, 2015 11:22 am

Re: Missing sharing libraries

Sat Apr 20, 2019 8:39 pm

Code: Select all

$ apt-file search /opt/vc/lib/libGLESv2.so
libraspberrypi0: /opt/vc/lib/libGLESv2.so

$ apt-file search /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0
libgles2-mesa: /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0
^^^
The files are different on my rpi.

Hint for figuring it out..

Code: Select all

sudo apt-get install apt-file mlocate
sudo updatedb #man locate
sudo apt-file update #man apt-file
Looks like you best revert those changes. There's actually a third libGLESv2 on the above rpi (for chromium)..

Code: Select all

$ locate libGLESv2.so
/opt/vc/lib/libGLESv2.so
/usr/lib/arm-linux-gnueabihf/libGLESv2.so
/usr/lib/arm-linux-gnueabihf/libGLESv2.so.2
/usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0
/usr/lib/chromium-browser/libGLESv2.so

Return to “C/C++”