Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load dynamic library /usr/lib/OGRE/RenderSystem_GL

Tags:

c++

ubuntu

ogre

I am trying to run a program in C++ but I am getting this error:

terminate called after throwing an instance of 'Ogre::InternalErrorException' what():  OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library /usr/lib/OGRE/RenderSystem_GL.  System Error: /usr/lib/OGRE/RenderSystem_GL.so: cannot open shared object file: No such file or directory

I have installed the Ogre libraries but this problem still persists. Any help on which package do I need to install to get rid of this error? I am using Ubuntu 14.04.

like image 777
Muhammad Omer Avatar asked Feb 12 '23 16:02

Muhammad Omer


2 Answers

OGRE libraries shipped by Ubuntu are installed in /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/ (or -1.8.0), not in /usr/lib/OGRE/.

Your program is attempting a dlopen or similar with an absolute path. If you cannot modify the program so that it uses the new path (or, better, it lets the linker decide what path to use), the easiest solution is creating a symlink with:

sudo ln -s /usr/lib/x86_64-linux-gnu/OGRE-1.9.0/ /usr/lib/OGRE/
like image 155
Stefano Sanfilippo Avatar answered Feb 15 '23 04:02

Stefano Sanfilippo


Try ldd YOUR_BINARY to see if it can find the dynamic linking libs it requires.

like image 35
Christopher C. S. Ke Avatar answered Feb 15 '23 06:02

Christopher C. S. Ke