Reputation: 1
I installed opencv 3.0 and extract. Then i open a project and add directories, libraries to the properperty but when i write simple test program it does not work. I followed tutorial.
#include "stdafx.h"
#include <iostream>
#include <opencv2/opencv.hpp>
void main()
{
std::cout << "OpenCV Version: " << CV_VERSION << std::endl;
}
cannot open source file "opencv2/opencv.hpp"
identifier "CV_VERSION" is undefined
C2100 illegal indirection
Upvotes: 0
Views: 2381
Reputation: 569
Update Opencv 3.1 just released and prebuild libs now support VC14 for Visual Studio 2015 . Just download opencv for windows from main page. Extract the opencv and use standard tutorials install opencv on windows: Instalation by using prebuild libs. Before you include header files you have to set enviromentall path by setx -m OPENCV_DIR command and in enviromental variables Path editor just set %OPENCV_DIR%\bin the folder where is DLLs are located.
If you want to use prebuild libs with Visual Studio 2015. You need some libs relater to older version.
One option is install redistributable Packages for older Visual Studio. And include this libs directly in your app from ProgramFiles/MicrosoftSDK/Windows/version/libs. This path find simply during the instalation. This is for Visual studio 2013 here Package Here
Better is recompile opencv with cmake and visual studio.
Build opencv with Visual Studio 2015 compiler from source first. This reduce a risk that older framework missing in your computer. You need vc14 directory as a source of your libs. Prebuild libs are only for VS 2012 and 2013, which is VC11 and VC12 libs folder under your opencv/build/x64 or x86. Speps are simple.
Check this picture by picture tutorial. Tutorial Here
Upvotes: 1