开发者

I can't run openCV2.3.1 with VS2010

I can't run openCV with VS2010. I downloaded OpenCV-2.3.1-win-superpack and extract openCV2.3.1 in C:\opencv and use CMake buide project into C:\opencv\vs2010. Next, I set include all module and lib to C:\opencv\build\x86\vc10\lib and set Additional Dependencies to

opencv_core231d.lib opencv_highgui231d.lib opencv_imgproc231d.lib opencv_features2d231d.lib opencv_calib3d231d.lib

After that I copy from C:\opencv\build\x86\vc10\bin to folder Debug in my project.

I build this code no any error.

include "stdafx.h"

include "opencv2/core/core.hpp"
include "opencv2/highgui/highgui.hpp"

int main(){
    cv::Mat image = cv::imread("Desert.jpg");
    cv::namedWindow("My Image");
    cv::imshow("My Image", image);
    cv::waitKey(5000);

    return 1;
}

but when I run this code it show this error alert.

Unhandled exception at 0x0f6d49a6 in OpenCV_Helloworld.exe: 0xC0000005: Access violation reading location 0x00000018.

when I click breake it show

No Source Available No symbols are loaded for any call stack frame. The source code cannot be displayed. Call stack location: KernelBase.dll!75289617()

In openCV tutorial use old version for openCV installation. So I find in google and install follow that. I'm not sure I miss take in this code or installation.

I create new Project and config like this Setup OpenCV-2.3 for Visual Studio 2010 and copy all dll to Debug folder in my Project. I build no error but when I run it show this error.

'opencv_hello.exe': Loaded 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\sechost.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Users\PKRU\Documents\Visual Studio 2010\Projects\opencv_hello\Debug\opencv_core231d.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows开发者_开发问答\System32\msvcp100d.dll', Symbols loaded.
'opencv_hello.exe': Loaded 'C:\Windows\System32\msvcr100d.dll', Symbols loaded.
'opencv_hello.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7600.16385_none_ebf82fc36c758ad5\comctl32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\avifil32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\winmm.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\msacm32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\msvfw32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\shell32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\shlwapi.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\avicap32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\version.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\imm32.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\msctf.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\cryptbase.dll', Cannot find or open the PDB file
'opencv_hello.exe': Loaded 'C:\Windows\System32\uxtheme.dll', Cannot find or open the PDB file
The program '[5308] opencv_hello.exe: Native' has exited with code -1 (0xffffffff).


have you checked if the imread worked?

if ( image.data == NULL ) {
   // failed
}


Go to Options>Debugging>Symbol and check 'Microsoft symbol server' as Symbol file(.pdb) locations'. This worked for me to get rid of 'Cannot find or open the PDB file' error.


Did you copy opencv_highgui231d.dll to the build output directory as well? I can see that it loads opencv_core dll but not the highgui one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜