我正在使用 opencv 库和 VS2012 运行程序。我使用的是windows 7 64位,所以我通过项目属性将配置管理器更改为x64。在我系统的环境变量中,我首先从命令提示符创建了这些条目:
setx -m OPENCV_DIR C:\OpenCV\build
并将其添加到系统路径中:%OPENCV_DIR%\build\x64\vc11\bin
在 Visual Studio 的属性管理器中,我将以下文件夹链接添加到项目属性:
在 C/C++ 下,附加包含目录,我添加了:
$(OPENCV_DIR)\include
在链接器,附加库目录下,我添加了;
$(OPENCV_DIR)\x64\vc10\lib;
链接器、输入、附加依赖项,我添加了以下内容:
opencv_core244d.lib opencv_imgproc244d.lib opencv_highgui244d.lib opencv_ml244d.lib opencv_video244d.lib opencv_features2d244d.lib opencv_calib3d244d.lib opencv_objdetect244d.lib opencv_contrib244d.lib opencv_legacy244d.lib opencv_flann244d.lib opencv_gpu244d.lib opencv_nonfree244d.lib opencv_photo244d.lib opencv_stitching244d.lib opencv_ts244d.lib opencv_videostab244d.lib
当我运行我的程序时,我遇到了这个错误
“ConsoleApplication0.exe”(Win32):已加载“D:\configuration\ConsoleApplication0\x64\Debug\ConsoleApplication0.exe”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\ntdll.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\kernel32.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\KernelBase.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\opencv\build\x64\vc11\bin\opencv_core244d.dll”。无法找到或打开 PDB 文件。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\msvcp110d.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\msvcr110d.dll”。已加载符号。' ConsoleApplication0.exe' (Win32): 加载'C:\opencv\build\x64\vc11\bin\opencv_imgproc244d.dll'。无法找到或打开 PDB 文件。“ConsoleApplication0.exe”(Win32):已加载“C:\opencv\build\x64\vc11\bin\opencv_highgui244d.dll”。无法找到或打开 PDB 文件。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\user32.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\gdi32.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\lpk.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\usp10.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\msvcrt.dll”。已加载符号。'ConsoleApplication0.exe' (Win32): 加载'C:\Windows\System32\ole32.dll'。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\rpcrt4.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\oleaut32.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\advapi32.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\sechost.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\winsxs\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_a4d6a923711520a9\comctl32.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\msvfw32.dll”。已加载符号。'ConsoleApplication0.exe' (Win32): 加载'C:\Windows\System32\winmm.dll'。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\shell32.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\shlwapi.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\avifil32.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\msacm32.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\avicap32.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\version.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\opencv\build\x64\vc11\bin\opencv_objdetect244d.dll”。无法找到或打开 PDB 文件。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\imm32.dll”。已加载符号。“ConsoleApplication0.exe”(Win32):已加载“C:\Windows\System32\msctf.dll”。已加载符号。程序“[4228] ConsoleApplication0.exe”已退出,代码为 1 (0x1)。
有谁知道为什么会这样?