missing shared library error

arborist

27-06-2011 21:43:40

Hello,

I'm doing this on a Fedora 15 Linux system with Ogre3d from the official repository which is version 1.7. I tried both using the bullet library from the repositories and compiling OgreBullet form the svn and also manually compiling bullet and OgreBullet from svn.

The problem is that I try to get a simple test application with OgreBullet up running. It compiles without error using this command:


g++ TutorialApplication.cpp BaseApplication.cpp -I /usr/include/OGRE/ -I /usr/include/OIS/ -I /usr/local/include/OgreBullet/Collisions/ -I /usr/local/include/OgreBullet/Dynamics/ -I /usr/local/include/bullet/ -lOgreMain -lOIS -lBulletDynamics -lBulletCollision -lOgreBulletCol -lOgreBulletDyn -lConvexDecomposition -o ogreapp


However, when I try start the resulting binary I get:


./ogreapp
./ogreapp: error while loading shared libraries: libOgreBulletCol.so.0: cannot open shared object file: No such file or directory


I've found that someone else on this forum had this problem before (http://www.ogre3d.org/addonforums/viewtopic.php?f=12&t=13119), but the solution he suggested appears to be to just include and link against bullet which I'm already doing.
So, any help is really appreciated.

Thanks in advance!

dermont

28-06-2011 12:18:28

Don't know what default paths for ld are on Fedora 15 Linux system but if /etc/ld.so.conf contains /usr/local/lib then running ldconfig should resolve you problem.

Otherwise you could either:

a) add rpath and library path to your build command -L/usr/local/lib -Wl,-rpath=/usr/local/lib
b) install OgreBullet to /usr with
./configure -prefix=/usr ...
make clean
make
..

arborist

28-06-2011 19:22:06

Using your a) suggestion got rid of the missing library error. Now I actually get some runtime error (but that's ok since I'm just messing around with the source). But I don't really understand why that helped because I would think that if there were a missing library the linker would complain during compilation and not when the binary has already been created. Anyway, thanks a lot for your help.

dermont

28-06-2011 19:50:14

http://linux.about.com/library/cmd/blcmdl1_ld.htm (Section -rpath-link DIR)
http://tldp.org/HOWTO/Program-Library-H ... aries.html (Section 3.2. How Libraries are Used)
http://www.eyrie.org/~eagle/notes/rpath.html

arborist

28-06-2011 21:59:14

Thanks, that cleared things up.