Why can't my program find the libraries in "/usr/local/lib"? [duplicate]
By Emma Johnson •
I'm on Ubuntu 10.10, and I've just upgraded opencv to 2.4.2.
The problem is that each time I open a new shell and try to compile and run, it compiles but doesn't run due to the following error:
./a.out: error while loading shared libraries: libopencv_calib3d.so.2.4: cannot open shared object file: No such file or directoryAs far as I can see, this file is located in /usr/local/lib/!
I can get it to run by running the following beforehand:
export LD_LIBRARY_PATH=/usr/local/libHow can I fix this issue?
11 Answer
/usr/local/lib is not in the default Ubuntu path. You should add it at the end of the LD_LIBRARY_PATH environment variable in /etc/environment. Reboot and the new path will be effective.
You can also set this on a per-user basis in ~/.bashrc
Example (/etc/environment)
LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/libExample (~/.bashrc)
export LD_LIBRARY_PATH="/lib:/usr/lib:/usr/local/lib" 3 More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"