Ask Your Question
0

Error 1 error C1083: Cannot open include file: 'opencv2/core/core.hpp': No such file or directory

asked 2014-04-25 17:05:28 -0600

hey everyone

i followed all the step given in the guide but when i try the code:

include <opencv2 core="" core.hpp="">

include <opencv2 highgui="" highgui.hpp="">

include <iostream>

using namespace cv; using namespace std;

int main( int argc, char** argv ) { if( argc != 2) { cout <<" Usage: display_image ImageToLoadAndDisplay" << endl; return -1; }

Mat image;
image = imread(argv[1], IMREAD_COLOR); // Read the file

if(! image.data ) // Check for invalid input
{
    cout << "Could not open or find the image" << std::endl ;
    return -1;
}

namedWindow( "Display window", WINDOW_AUTOSIZE ); // Create a window for display.
imshow( "Display window", image ); // Show our image inside it.

waitKey(0); // Wait for a keystroke in the window
return 0;

}

it gives me the error cannor open or include opencv2/core/core.hpp no such file or directory !!

little help here plz :)

edit retag flag offensive close merge delete

Comments

Check OpenCV include path, and make sure OpenCV headers are there.

Haris gravatar imageHaris ( 2014-04-25 22:48:48 -0600 )edit
1

in VS, set the "additional include dirs" to opencv/build/include

berak gravatar imageberak ( 2014-04-26 00:10:05 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
-1

answered 2014-04-25 23:56:50 -0600

KeHe gravatar image

make sure you have followed the all steps in the configuration, maybe you can have try include <highgui.h>

edit flag offensive delete link more

Comments

1

nice, that you're trying to help, but this is a bad idea.

the code is already using the correct headers (the problem is more, finding them).

<highgui.h> is from the arcane c-api. avoid it.

berak gravatar imageberak ( 2014-04-26 00:36:13 -0600 )edit

Question Tools

Stats

Asked: 2014-04-25 17:05:28 -0600

Seen: 478 times

Last updated: Apr 25 '14