The character 'cv' cannot be resolved in eclipse

I am trying to configure openCV in eclipse, in the include path I added

/usr/local/include/opencv /usr/local/include 

and I used pkg-config -libs opencv to add the library to GCC C ++ Linker:

 /usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so ... 

in the header file i included:

 #include <opencv2/highgui/highgui.hpp> #include <opencv2/core/eigen.hpp> 

but when i announce

 using namespace cv; 

I get an error: Symbol 'cv' could not be resolved

+6
source share
3 answers

The problem is that the linker cannot find the character named cv .

Suppose you installed everything correctly, i.e. that each file [1] is where it should be, because you did not tell the linker which files it should reference.

Note Are there actually files listed by pkg-config --libs opencv ?


Decision

  • Go to your project properties
  • click C / C ++ Build
  • click Settings
  • find GCC C ++ Linker (on the Tool Options tab)
    • click "Libraries"
    • Add OpenCV Libraries.

DETAILED GUIDE

OpenCV has an official guide for working with Eclipse:

+7
source

In the GCC C ++ compiler, you must first include / usr / local / include . See the following image.

enter image description here

+3
source

You must enable opencv.hpp
go to the GCC C ++ compiler, go to the "Includes" section. In Include File (-l) add / usr / include / opencv2 / opencv.hpp

0
source

Source: https://habr.com/ru/post/970218/


All Articles