Problems running OpenCV in VS 2012 express for desktop.

asked 2016-03-10 12:22:06 -0500

YaddyVirus gravatar image

Hi there. I am a complete beginner to OpenCV. I downloaded it today and tried installing it on my pc using the documentation on this site. After a while I figured out that the documentation was for version 2.14 and was very, very complex. They were using VS 2010 and I have 2012. So I headed to YouTube and found these tutorials-

  1. Installing OpenCV -

  2. Configuring it with Visual Studio-

However, I had already completed the first part of the documentation(which does something with a command prompt and makes environment variables. But I ignored that and followed both the tutorials and when I tried to run the sample code. I got errors on two lines. Here's the code-

include iostream

include opencv2/opencv.hpp // VS says it cannot open source file.

void main()

{ std::cout << "OpenCV Version: " << CV_VERSION << std::endl;// VS says indetifier CV_VERSION is unidentified. }

This program is supposed to show the OpenCV version I have on my pc, but I cannot get it to run. Is my OpenCV installation valid? If not then how can I repair it? I have already checked the paths a lot of times. I just can' seem to figure out what to do. Any and all help will be greatly appreciated.

Thank you -YaddyVirus

edit retag flag offensive close merge delete