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,
i can access methods in cv namespace why still getting error ?
have look,
all functions of opencv accessible still i'm getting error aforementioned.
please guide me.
- in .pro file include headers..
- link libraries...
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..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
Post a Comment