Question

I have compiled casablanca and have put -l:/~/path/to/lib/libcasablanca.so in my CMakeList.txt. I have build my application and I have got no errors. But when I run the executable it says:

./myproj: error while loading shared libraries: libcasablanca.so: cannot open shared object file: No such file or directory

I have done it on another computer and it seems to work fine.

Does anyone know what is the problem? How to fix this?

I have no administrator access to this machine.

Was it helpful?

Solution

This is very simple: your library is not in the default system path from them the shared libraries are imported. During the compilation, the compile scripts solved these problems. In runtime, you have the LD_PRELOAD or LD_LIBRARY_PATH environment variables.

For example: an export LD_LIBRARY_PATH=/home/darkside/wunderprog/lib will extend the directoried searched for your libraries with the named directory. If there is your libcasablanca.so, you will get what you want.

Normally I use a /home/<myusername>/lib directory in my useronly accounts and set LD_LIBRARY_PATH from .profile.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top