I've set up an OpenCV C++ project in Visual Studio 2012. To get it working I have use various project property pages to
- Additional Include Directories: $(SolutionDir)..\Libs\OpenCV\2.4.6\include
- Additional Library Directories: $(SolutionDir)..\Libs\OpenCV\2.4.6\$(Platform)\$(Configuration)
- Additional Dependencies: various files including
opencv_highgui246d.dll
Post-Build Event, Command Line: copies over the DLLs and lib files and some sample content thus:
xcopy /y $(SolutionDir)..\Libs\OpenCV\2.4.6\$(Platform)\$(Configuration)*.dll $(ProjectDir)$(Platform)\$(Configuration)\ xcopy /y $(SolutionDir)..\Libs\OpenCV\2.4.6\$(Platform)\$(Configuration)*.lib $(ProjectDir)$(Platform)\$(Configuration)\ xcopy /y $(ProjectDir)opencv-logo.jpg $(ProjectDir)$(Platform)\$(Configuration)\ xcopy /y $(ProjectDir)sample.wmv $(ProjectDir)$(Platform)\$(Configuration)\
The lines of code I'm trying to debug are more-or-less the same as those in the sample code given for the VideoCapture
OpenCV class here: http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html
VideoCapture cap(0); // open the default camera
if(!cap.isOpened()) // check if we succeeded
return -1;
but I am opening a file
VideoCapture cap ("sample.wmv");
if (FileExists("sample.wmv"))
{
OutputDebugString("File exists\n");
}
else
{
OutputDebugString("File does not exist\n");
}
if(!cap.isOpened())
{
cout <<"Failed to open camera" << endl;
OutputDebugString("Failed to open camera\n");
return -1;
}
Something's going wrong so I want to check what the properties are on cap
by setting a breakpoint on the line if(!cap.isOpened())
. But if I try to examine cap
in the locals window in Visual Studio 2012 I get the error:
"Information not available, no symbols loaded for opencv_highgui246d.dll"
I'm unfamiliar with setting up C++ projects in Visual Studio (I've been using mostly C# for years now); what do I need to do to enable this debugging? Do I have to build OpenCV myself (and if so what output should I use where) or are there more files I can copy over and include in my build?