Windows 8.1 中 Visual Studio 12 中的 OpenCV 错误。这是调试时显示一些错误的简单代码。我怎样才能解决这个问题?

Posted

技术标签:

【中文标题】Windows 8.1 中 Visual Studio 12 中的 OpenCV 错误。这是调试时显示一些错误的简单代码。我怎样才能解决这个问题?【英文标题】:Errors for OpenCV in Visual Studio 12 in windows 8.1. Here's the simple code when debugging it says some errors. How can i fix this? 【发布时间】:2014-07-04 23:13:49 【问题描述】:
    **#include <opencv\cv.h>
    #include <opencv\highgui.h>sing namespace cv;
    int main()
    
        // Create matrix to store.
        Mat image;
        // initializing capture
        VideoCapture cap;
        cap.open(0);
        //create window to show image
        namedWindow("window",1);
        // copy webcam stream to image
        cap>>image;
        //print image to screen
        imshow("window",image);

        // delay 33ms
        waitKey(33);

    **
and the errors are 







**'And, its errors are  ''OpenCV.exe' (Win32): Loaded 'C:\Users\Uzzal
    Das\Documents\Visual Studio 2012\Projects\OpenCV\Debug\OpenCV.exe'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\ntdll.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Opencv243\build\x86\vc10\bin\opencv_core243d.dll'. Cannot find
    or open the PDB file. 'OpenCV.exe' (Win32): Loaded
    'C:\Opencv243\build\x86\vc10\bin\opencv_highgui243d.dll'. Cannot
    find or open the PDB file. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\msvcp110d.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\msvcr110d.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Users\Uzzal Das\Documents\Visual
    Studio 2012\Projects\OpenCV\Debug\msvcp100d.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Users\Uzzal Das\Documents\Visual
    Studio 2012\Projects\OpenCV\Debug\msvcr100d.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\gdi32.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\advapi32.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\comctl32.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\avifil32.dll'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\msvfw32.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\avicap32.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\msvcrt.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\winmm.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\msacm32.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\version.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\shlwapi.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\devobj.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Symbols
    loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\imm32.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded
    'C:\PROGRA~2\SupTab\SearchProtect32.dll'. Cannot find or open the
    PDB file. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\kernel.appcore.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\clbcatq.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\devenum.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\ntmarta.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\wintrust.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\crypt32.dll'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\msasn1.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\msdmo.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\qcap.dll'. Symbols
    loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\quartz.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ksproxy.ax'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\ksuser.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\d3d9.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vidcap.ax'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\Kswdmcap.ax'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded 'C:\Windows\SysWOW64\mfc42.dll'. Symbols loaded.
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\odbc32.dll'.
    Symbols loaded. The thread 0x17a0 has exited with code 0 (0x0).
    'OpenCV.exe' (Win32): Loaded 'C:\Windows\SysWOW64\qedit.dll'.
    Symbols loaded. 'OpenCV.exe' (Win32): Loaded
    'C:\Windows\SysWOW64\comdlg32.dll'. Symbols loaded. 'OpenCV.exe'
    (Win32): Loaded
    'C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.9600.17056_none_dadc5d1c5bc8ab48\GdiPlus.dll'.

符号已加载。 “OpenCV.exe”(Win32):已加载 'C:\Windows\SysWOW64\SHCore.dll'。已加载符号。 'OpenCV.exe' (Win32): 加载 'C:\Windows\SysWOW64\ddraw.dll'。已加载符号。 “OpenCV.exe”(Win32):已加载“C:\Windows\SysWOW64\dciman32.dll”。 已加载符号。 “OpenCV.exe”(Win32):已加载 'C:\Windows\SysWOW64\igdumdim32.dll'。无法找到或打开 PDB 文件。 “OpenCV.exe”(Win32):已加载 'C:\Windows\SysWOW64\igdusc32.dll'。无法找到或打开 PDB 文件。 “OpenCV.exe”(Win32):已加载 'C:\Windows\SysWOW64\d3dim700.dll'。已加载符号。 'OpenCV.exe' (Win32): 卸载 'C:\Windows\SysWOW64\igdusc32.dll' 'OpenCV.exe' (Win32): 卸载 'C:\Windows\SysWOW64\igdumdim32.dll' 'OpenCV.exe' (Win32): 加载'C:\Windows\SysWOW64\igdumdim32.dll'。找不到或 打开 PDB 文件。 “OpenCV.exe”(Win32):已加载 'C:\Windows\SysWOW64\igdusc32.dll'。无法找到或打开 PDB 文件。 “OpenCV.exe”(Win32):已卸载 'C:\Windows\SysWOW64\igdusc32.dll' 'OpenCV.exe' (Win32): 已卸载 'C:\Windows\SysWOW64\igdumdim32.dll' 'OpenCV.exe' (Win32): 已加载 'C:\Windows\SysWOW64\msyuv.dll'。已加载符号。 'OpenCV.exe' (Win32): 卸载 'C:\PROGRA~2\SupTab\SearchProtect32.dll' 线程 0x15ec 以代码 0 (0x0) 退出。线程 0x4c0 有 以代码 0 (0x0) 退出。 “OpenCV.exe”(Win32):已卸载 'C:\Windows\SysWOW64\msyuv.dll' 线程 0x14d4 已退出 代码 0 (0x0)。线程 0x9f8 以代码 0 (0x0) 退出。这 线程 0x15f4 以代码 0 (0x0) 退出。程序'[6988] OpenCV.exe' 已退出,代码为 0 (0x0)。'

    ----------
'**

【问题讨论】:

这些都不是错误。如果你真的想进入微软代码,你可以安装符号,但这不是必需的。尽管您为错误的编译器使用已编译的 opencv。 vc10 二进制文件适用于 Visual Studio 2010 而不是 2012。您应该为 Visual Studio 2012 使用 vc11 二进制文件。 【参考方案1】:

opencv 无法加载 pbd 文件的问题是由于使用了与您使用的编译器不同的编译器编译的 dll 引起的。在这种情况下,您在 Visual Studio 2012 应用程序中使用 Visual Studio 2010 dll。通常,通过使用用不同版本的 Visual Studio 编译的 dll 或在同一应用程序中混合调试和发布来混合编译器是不安全的。主要原因是当您这样做时,您将拥有超过 1 个独立堆。您不能安全地在 1 个堆中分配内存并在第二个堆中释放它。这将导致堆损坏,这可能会导致看起来随机的崩溃,因为在堆损坏后的第一次分配/释放时损坏可能不会崩溃。

要解决此问题,请确保您将项目设置为为编译器使用正确的 opencv dll。对于 Visual Studio 2012,正确的 dll 将位于 vc11 文件夹中。

【讨论】:

感谢您的帮助:)

以上是关于Windows 8.1 中 Visual Studio 12 中的 OpenCV 错误。这是调试时显示一些错误的简单代码。我怎样才能解决这个问题?的主要内容,如果未能解决你的问题,请参考以下文章

锁定 Windows 8.1 时 Visual Studio 2013 和 2015 崩溃

Windows 8.1 中 Visual Studio 12 中的 OpenCV 错误。这是调试时显示一些错误的简单代码。我怎样才能解决这个问题?

Visual Studio 2015 RC 社区版目标平台在 Windows 8.1 上设置为 Windows 10 TP

如何在 Windows 8.1 上安装 SDL 并将其连接到 Visual Studio Community 2013

对于标准 C++,我应该将 Windows 8.1 SDK 或 Windows 10 SDK 与 Visual Studio 2017 一起使用吗?

Visual Studio2017 & pcl1.8.1 库的配置