Cannot get the OpenCV libraries to work with eclipse

Asked by Manuel Mosquera

Hi everyone, for some reason after installing OpenCV when I use the command:

pkg-config opencv --libs

I get the following output:

usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_ts.so /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so

I unsderstand that the above files are the libraries. However, when I put those libraries in ECLIPSE on settings of my project, it gives me an error. I unsderstand that it is because I have to use the libraries in the form

-lopencv
-lopencv_videostab
...

but I do not have any clue how I can accomplish this. I really appreciate the help.

Regards,
Manuel Mosquera

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu opencv Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Warren Hill (warren-hill) said :
#1

In your eclipse: right click on the project name and select Properties.

In the dialogue box that opens select "C/C++ Build" > "Settings" > "GCC C Linker" > "Libraries".

In the Libraries (-l) click the add icon and and the libraries one at a time.

Can you help with this problem?

Provide an answer of your own, or ask Manuel Mosquera for more information if necessary.

To post a message you must log in.