I\'m trying to use the new OpenCV 2.0 API in MS Visual C++ 2008 and wrote this simple program:
cv::Mat img1 = cv::imread(\"image.jpg\",1);
cv::namedWindow(\"
I had the same problem described above which turns out to be caused by the settings of the linker.
I found the answer in another thread, OpenCV 2.3 and Visual Studio 2010.
To repeat it here:
Properties of your project (right click on it)
- C/C++
- General
- include directory add the < your directory >\OpenCV2.3\include\opencv2, < your directory >\OpenCV2.3\include\opencv and < your directory >\OpenCV2.3\include
Linker
- General
- List item
- Input
- Add all the libs like opencv_core230d.lib opencv_highgui230d.lib and so on...
Once I've done the above, I can run imshow and imread + all other cpp functions seamlessly! OP's problem has probably already been resolved, but hopefully this will be useful to other people who are led here looking for the same solution.