Finally with opencv (win7 64-bit + vs2013 + opencv2.4.9), I was excited to write the first program (of course, it was showing the jade photos of Lena ):
1 #include <opencv2\opencv.hpp> 2 #include<iostream> 3 //using namespace cv; 4 5 void main() 6 { 7 IplImage *src; 8 src = cvLoadImage("lena.jpg"); //这里将lena.jpg和lena.cpp文件放在同一个文件夹下 9 cvNamedWindow("lena", CV_WINDOW_AUTOSIZE);10 cvShowImage("lena", src);11 cvWaitKey(0);12 cvDestroyWindow("lena");13 cvReleaseImage(&src);14 }
Result vs has the following error message:
The first reaction is that the link library has a problem. Previously, opencv was configured on a 32-bit computer. Therefore, it is estimated that the computer encountered a 64-bit error. After checking for a long time, I finally found the problem:
During compilation, the Win32 platform is still used.
Solution: Go to "Property Manager", right-click the project, and go to "property", for example:
Click "Configuration Manager" in the upper right corner:
Click Win32 under "Active solution platform" in the upper right corner and select the x64 new platform:
Replace the Win32 platform shown in the "Configuration Manager" with the x64 platform. Return to the program as follows:
If you compile the program again, the system will not report an error:
opencv configuration problem _ error lnk2019