2

I am trying to run the simple test code below on Visual Studio 2015 with OpenCv 3.1 on windows 10.

#include <opencv2\opencv.hpp>
using namespace cv;
int main()
{
namedWindow("win");
waitKey(0);
return 1;
}

But i get

Error C1083 Cannot open include file: 'opencv2\opencv.hpp': No such file or directory

I have added the Path C: \ opencv \ build \ x64 \ vc14 \ bin to System variable in the Windows Environment variables.

Also in Visual studio I have set the Include Directories C:\opencv\build\include;$(IncludePath) under Project properties > VC++ Directories and also the Linker > Input Additional Dependencies set to opencv_world310d.lib (Debug)

I also have the following setting:

Executable Directories - C:\opencv\build\x64\vc14

Library Directories - C:\opencv\build\x64\vc14\lib

Additional Library Directories - C:\opencv\build\x64\vc14\lib

Please help me resolve this error.

3
  • 1
    Does C:\opencv\build\include\opencv2 contain the opencv.hpp file? Commented May 1, 2016 at 9:02
  • 1
    Yes it does C:\opencv\build\include\opencv2\opencv.hpp Commented May 2, 2016 at 7:08
  • OpenCV is a pain to get working with Visual Studio on a per-project basis! It's slower, but I usually just use Accord and pull it in with nuget! Commented May 9, 2016 at 7:35

1 Answer 1

3

I found the solution finally, on the Project > Properties I had to change platform to x64 and the set the bin, lib and include folders again

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.