简体   繁体   中英

C++ OpenCV “Cannot find or open PDB file” and "(opencv_world310.dll) in Project2.exe: Access violation reading location

I'm new at programing and I get stuck in my visual studio using C++ and openCV, because when I run some code the program give output : Cannot find or open PDB file and (opencv_world310.dll) in Project2.exe: 0xC0000005: Access violation reading location 0x00000000056AE000. I don't know what should i do, i try some solution on Internet but cant solve my problem in whole week :(

This is my code:

#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);
}

and this is my output:

'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).

Please can anyone help me to solve this one? :(

Thanks^^

PDB Files are used for debugging. You can load them by doing :

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

Try to open your image "cow.jpg" first and show it with: imshow("myWindows",im); to see if your image is correctly loaded and comments other lines.

Remember to include opencv dependencies in :

Project Properties/Linker/Input/Supplementary Dependencies

Add the paths (depends to your installation)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM