Problem on Set up Opencv on VS2010
I try to set up Opencv2.4.9 on VS2010(32 bit) on my 64 bit Win7.
I set the Environment Path to both ..\opencv\build\x64\vc10\bin and ..\opencv\build\x86\vc10\bin
In VS2010,
I set Executable Directories to ..\opencv\build\x86\vc10\bin;
Include Directories to ..\opencv\build\include; ..\opencv\build\include\opencv; ..\opencv\build\include\opencv2
Library Directories to ..\opencv\build\x86\vc10\lib
and includes all these libs: opencv_calib3d249d.lib opencv_contrib249d.lib opencv_core249d.lib opencv_features2d249d.lib opencv_flann249d.lib opencv_gpu249d.lib opencv_highgui249d.lib opencv_imgproc249d.lib opencv_legacy249d.lib opencv_ml249d.lib opencv_nonfree249d.lib opencv_objdetect249d.lib opencv_photo249d.lib opencv_stitching249d.lib opencv_ts249d.lib opencv_video249d.lib opencv_videostab249d.lib
But I still can't run the most simple example:
#include "cv.h"
#include "highgui.h"
using namespace cv;
using namespace std;
int main(int argc, char* argv[])
{
Mat img = imread("lena.jpg");
if(!img.data)
{
cout<<"error"<<endl;
waitKey();
return -1;
}
namedWindow("loveLena", CV_WINDOW_AUTOSIZE);
imshow("loveLena", img);
waitKey();
return 0;
}
It reports:
'test.exe': Loaded 'C:\Users\Admin\Documents\Visual Studio 2010\Projects\test\Debug\test.exe', Symbols loaded.
'test.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'test.exe': Loaded 'D:\unzip_cv\opencv\build\x86\vc10\bin\opencv_core249d.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Cannot find or open the PDB file
'test.exe': Loaded 'D:\unzip_cv\opencv\build\x86\vc10\bin\opencv_highgui249d.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18201_none_ec80f00e8593ece5\comctl32.dll', Cannot find or open the PDB file
'test.exe': Loaded 'C:\Windows\SysWOW64\avifil32.dll ...
look at your code, it exited with -1 meaning: your image was not found.
(also, you're safe to ignore the 'Cannot find or open the PDB file' messages. the resp. PDB files are not supplied. if you really need them, rebuild the opencv libs locally)
Yes. The image location is not correct. I put it with my source file. I changed my image location and it works well. Thanks.