我已经建立了在Visual Studio 2012的OpenCV的C++项目得到它的工作我必须使用不同的项目属性页如何及在哪里添加调试符号为Visual C++ OpenCV的项目
- 附加包含目录:$(SolutionDir).. \ Libs \ OpenCV \ 2.4.6 \ include
- 其他库目录:$(SolutionDir).. \ Libs \ OpenCV \ 2.4.6 \ $(Platform)\ $(Configuration)
- 附加依赖关系:各种文件,包括
opencv_highgui246d.dll
生成后事件,命令行:复制DLL和lib文件以及一些示例内容:
xcopy/y $(SolutionDir).. \ Libs \ OpenCV \ 2.4.6 \ $(Platform)\ $(Configuration)*。 dll $(ProjectDir)$(Platform)\ $(Configuration)\ xcopy/y $(SolutionDir).. \ Libs \ OpenCV \ 2.4.6 \ $(Platform)\ $(Configuration)* .ib $(ProjectDir) $(ProjectDir)$(ProjectDir)$(Platform)$(Configuration)\ xcopy/y $(ProjectDir)sample.wmv $( ProjectDir)$(Platform)\ $(Configuration)\
我试图调试的代码行与示例代码giv中的代码行或多或少相同恩为VideoCapture
OpenCV的类此: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;
但我打开一个文件
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;
}
什么地方去错了,所以我要检查的属性上cap
什么就行设置断点if(!cap.isOpened())
。但是,如果我尝试在Visual Studio 2012的当地人窗口来检查cap
我得到的错误:
“的信息不可用,没有加载opencv_highgui246d.dll符号”
我不熟悉设立C++项目在Visual Studio中(我现在主要使用C#多年);我需要做什么来启用此调试?我是否必须自己构建OpenCV(如果是这样的话,我应该在哪里使用)或者是否有更多的文件可以复制并包含在我的构建中?
调试符号在.pdb文件中。如果您有opencv_highgui246d.pdb,则将其复制到与DLL相同的文件夹中。如果你没有它,那么你需要构建DLL来获取符号文件。 –