Opencv in QT giving error for no reason -


i trying use opencv library in qt i'm keep getting error shouldn't suppose occur.

here code of simple program.

#include <opencv2/highgui/highgui.hpp>   using namespace cv; //all classes , functions defined in c++ api of opencv defined within name space cv. using namespace std;   int main(){      mat image = imread("c:/opencv/opencv/samples/c/cat.jpg",cv_load_image_grayscale);      cout << "number of rows: " << image.rows << endl << "number of coloumn: " << image.cols;      imshow ("image",image);     waitkey(0); } 

c:\users\cipher\downloads\programs\untitled2\main.cpp:1: error: c1083: cannot open include file: 'highgui.hpp': no such file or directory

the problem that, file there qt couldn't able find file, can access file , when hold ctrl , move cursor on #include <opencv2/highgui/highgui.hpp> , click on accessing file, still qt keep saying find such file or directory :/ problem :/

have look,

enter image description here

i can access methods in cv namespace why still getting error ?

have look,

enter image description here

all functions of opencv accessible still i'm getting error aforementioned.

please guide me.

  1. in .pro file include headers..
  2. link libraries...
  3. add address of bin folder of opencv environmental variables.

    mat image = imread(""c:\\opencv\\opencv\\samples\\c\\cat.jpg",cv_load_image_grayscale") use double backslashes..

  4. your .pro file should dis..

    includepath += c:\opencv\build\include\ libs += -lc:\opencv\build_vs\lib\debug\

    -lopencv_core243d -lopencv_highgui243d -lopencv_video243d -lopencv_imgproc243d\


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -