Project2.exe中的C++ OpenCV“找不到或打开PDB文件”和“(opencv_world310.dll):访问冲突读取位置

Posted

技术标签:

【中文标题】Project2.exe中的C++ OpenCV“找不到或打开PDB文件”和“(opencv_world310.dll):访问冲突读取位置【英文标题】:C++ OpenCV "Cannot find or open PDB file" and "(opencv_world310.dll) in Project2.exe: Access violation reading location 【发布时间】:2016-04-12 20:32:10 【问题描述】:

我是编程新手,使用 C++ 和 openCV 卡在我的 Visual Studio 中,因为当我运行一些代码时,程序会给出输出:Cannot find or open PDB file(opencv_world310.dll) in Project2.exe: 0xC0000005: Access violation reading location 0x00000000056AE000. 我不知道该怎么办,我在网上尝试了一些解决方案,但整整一周都无法解决我的问题:(

这是我的代码:

#include "opencv2/opencv.hpp"

using namespace cv;
using namespace std;

int main(int argc, char* argv[])


    // Read image
    Mat im = imread("cow.jpg");
    Mat imout, imout_gray;

    // Edge preserving filter with two different flags.
    edgePreservingFilter(im, imout, RECURS_FILTER);
    imwrite("edge-preserving-recursive-filter.jpg", imout);

    edgePreservingFilter(im, imout, NORMCONV_FILTER);
    imwrite("edge-preserving-normalized-convolution-filter.jpg", imout);

    // Detail enhance filter
    detailEnhance(im, imout);
    imwrite("detail-enhance.jpg", imout);

    // Pencil sketch filter
    pencilSketch(im, imout_gray, imout);
    imwrite("pencil-sketch.jpg", imout_gray);

    // Stylization filter
    stylization(im, imout);
    imwrite("stylization.jpg", imout);

这是我的输出:

'Project2.exe' (Win32): Loaded 'C:\Users\Wu\Documents\Visual Studio 2015\Projects\Project2\x64\Debug\Project2.exe'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Program Files (x86)\AVG\Av\avghooka.dll'. Cannot find or open the PDB file.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\opencv 3.1.0\build\x64\vc14\bin\opencv_world310.dll'. Cannot find or open the PDB file.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\lpk.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\usp10.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\comdlg32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\winsxs\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_a4d6a923711520a9\comctl32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\msvfw32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\winmm.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\avifil32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\msacm32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\avicap32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-runtime-l1-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\winsxs\amd64_microsoft-windows-ucrt_31bf3856ad364e35_6.1.7601.18878_none_09aa4b40304c91e1\ucrtbase.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\winsxs\amd64_microsoft-windows-u..rsalcrt-apifwd-win7_31bf3856ad364e35_6.1.7601.18878_none_a9ab111a251a4c49\api-ms-win-core-timezone-l1-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\winsxs\amd64_microsoft-windows-u..rsalcrt-apifwd-win7_31bf3856ad364e35_6.1.7601.18878_none_a9ab111a251a4c49\api-ms-win-core-file-l2-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\winsxs\amd64_microsoft-windows-u..rsalcrt-apifwd-win7_31bf3856ad364e35_6.1.7601.18878_none_a9ab111a251a4c49\api-ms-win-core-localization-l1-2-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\winsxs\amd64_microsoft-windows-u..rsalcrt-apifwd-win7_31bf3856ad364e35_6.1.7601.18878_none_a9ab111a251a4c49\api-ms-win-core-synch-l1-2-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\winsxs\amd64_microsoft-windows-u..rsalcrt-apifwd-win7_31bf3856ad364e35_6.1.7601.18878_none_a9ab111a251a4c49\api-ms-win-core-processthreads-l1-1-1.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\winsxs\amd64_microsoft-windows-u..rsalcrt-apifwd-win7_31bf3856ad364e35_6.1.7601.18878_none_a9ab111a251a4c49\api-ms-win-core-file-l1-2-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-string-l1-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-heap-l1-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-stdio-l1-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-convert-l1-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-locale-l1-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-math-l1-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-multibyte-l1-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-time-l1-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-filesystem-l1-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-environment-l1-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-utility-l1-1-0.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\concrt140.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140d.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'. Cannot find or open the PDB file.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\OpenCL.DLL'. Cannot find or open the PDB file.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\IntelOpenCL64.dll'. Cannot find or open the PDB file.
'Project2.exe' (Win32): Loaded 'C:\Program Files (x86)\Common Files\Intel\OpenCL\bin\x64\intelocl64.dll'. Cannot find or open the PDB file.
'Project2.exe' (Win32): Loaded 'C:\Program Files (x86)\Common Files\Intel\OpenCL\bin\x64\task_executor64.dll'. Cannot find or open the PDB file.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\opengl32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\glu32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\ddraw.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\dciman32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\dwmapi.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\ntmarta.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\Wldap32.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Program Files (x86)\Common Files\Intel\OpenCL\bin\x64\cpu_device64.dll'. Cannot find or open the PDB file.
'Project2.exe' (Win32): Loaded 'C:\Program Files (x86)\Common Files\Intel\OpenCL\bin\x64\tbb\tbb.dll'. Cannot find or open the PDB file.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\igdrcl64.dll'. Cannot find or open the PDB file.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\dxgi.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\igdfcl64.dll'. Cannot find or open the PDB file.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\dbghelp.dll'. Symbols loaded.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\igdbcl64.dll'. Cannot find or open the PDB file.
'Project2.exe' (Win32): Loaded 'C:\Windows\System32\igdusc64.dll'. Cannot find or open the PDB file.
Exception thrown at 0x000007FEDB254D61 (opencv_world310.dll) in Project2.exe: 0xC0000005: Access violation reading location 0x00000000056AE000.

The program '[8724] Project2.exe' has exited with code 0 (0x0).

请谁能帮我解决这个问题? :(

谢谢^^

【问题讨论】:

【参考方案1】:

PDB 文件用于调试。您可以通过以下方式加载它们:

>Debug/Options/Symboles and now check "Microsoft Symbols Servers"

首先尝试打开您的图片"cow.jpg" 并显示: imshow("myWindows",im); 查看您的图像是否正确加载并与其他行匹配。

记得在 :

中包含 opencv 依赖项

项目属性/链接器/输入/补充依赖

添加路径(取决于您的安装)

C:\OpenCV_31\opencv\build\x64\vc14\lib\opencv_world310.lib C:\OpenCV_31\opencv\build\x64\vc14\lib\opencv_world310d.lib

【讨论】:

非常感谢您的回答:) 我的所有设置都与您的回答相同,但程序给我的输出仍然像以前一样,这就是为什么我卡在这个程序中:(你还有其他的吗解决方案。但非常感谢你:) 哼,试试下面的代码:Mat im = imread("cow.jpg"); imshow("mWindows", im); 不加别的,确保路径正确。 我还注意到您处于调试模式,但您的库是“opencv_world310.dll”而不是“opencv_world310d.dll” 调试的“d”。可能问题就在这里。您链接到发布库而不是调试。 感谢@TGuerin 的回复,我昨天必须更新我的代码并添加 imshow("mWindows", im);我的库既包含 opencv_world310.dll 也包含 opencvworld310d.dll (带 d),但那是输出,谢谢:)

以上是关于Project2.exe中的C++ OpenCV“找不到或打开PDB文件”和“(opencv_world310.dll):访问冲突读取位置的主要内容,如果未能解决你的问题,请参考以下文章

从 OpenCV(C++)中的目录读取多个图像

使用 C++ 在 OpenCV 中的矩阵中的多维数据

OpenCV 2.4 C++ 中的 chamferMatching 文档

C++ 中的 OpenCV:“未知类型名称”

在 C++ 和 OpenCV 中调用其他文件中的函数

Matlab 仍然比 C++ 中的 opencv 慢吗