ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

I suggest you do the following in a shell

$ pkg-config --libs --cflags opencv

Then accurately check the results of the command. If there still are missing libraries (as I think it is the case) then run

$ sudo updatedb
$ locate opencv_core (or any other missing lib)

This ought to tell you where the libraries are. Supposedly though nor the linker and neither pkg-config can find them, so probably they ended up installed in a place that is not on the pkg paths.

To check against this eventuality run

$ echo $LD_LIBRARY_PATH

This variable should contain the path to the OpenCV libs, if it is not so you have to add it OR move the libs in /usr/lib as they ought to be.

To proceed with the second solution you just have to do something like

$ sudo cp /root/user/path-to-OpenCV /usr/local/lib

For the first solution you have to edit the bash configuration file for your user

$ nano ~/.bashrc

A text editor will open, scroll to the last line. If you already have a line like

export LD_LIBRARY_PATH=something

than add the path to OpenCV to this line, otherwise create one like so

export LD_LIBRARY_PATH+=:/path/to/OpenCV

Close the shell window, reopen one (ALT+T shortcut) and retry the pkg-config, it should now be able to find your libraries.