首页 > 解决方案 > 找不到程序 .dll 文件

问题描述

我尝试遵循https://docs.opencv.org/3.1.0/d4/d18/tutorial_sfm_scene_reconstruction.html这段代码,但它无法构建。我使用 opencv 和 extra-contrib 版本 3.4.5

我试图将 .dll 添加到项目中,但它不起作用。

'scenceRecon.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'scenceRecon.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'scenceRecon.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'scenceRecon.exe' (Win32): Loaded 'E:\opencv\laster\install\x86\vc15\bin\opencv_core345d.dll'. Symbols loaded.
'scenceRecon.exe' (Win32): Loaded 'E:\opencv\laster\install\x86\vc15\bin\opencv_sfm345d.dll'. Symbols loaded.
'scenceRecon.exe' (Win32): Loaded 'E:\opencv\laster\install\x86\vc15\bin\opencv_viz345d.dll'. Symbols loaded.
'scenceRecon.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Cannot find or open the PDB file.
'scenceRecon.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file.
'scenceRecon.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
'scenceRecon.exe' (Win32): Loaded 'C:\Windows\SysWOW64\concrt140d.dll'. Cannot find or open the PDB file.
'scenceRecon.exe' (Win32): Loaded 'E:\opencv\laster\install\x86\vc15\bin\opencv_xfeatures2d345d.dll'. Symbols loaded.
'scenceRecon.exe' (Win32): Loaded 'E:\opencv\laster\install\x86\vc15\bin\opencv_features2d345d.dll'. Symbols loaded.
'scenceRecon.exe' (Win32): Loaded 'E:\opencv\laster\install\x86\vc15\bin\opencv_flann345d.dll'. Symbols loaded.
'scenceRecon.exe' (Win32): Loaded 'E:\opencv\laster\install\x86\vc15\bin\opencv_imgcodecs345d.dll'. Symbols loaded.
'scenceRecon.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
'scenceRecon.exe' (Win32): Loaded 'C:\Windows\SysWOW64\win32u.dll'. Cannot find or open the PDB file.
'scenceRecon.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
'scenceRecon.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32full.dll'. Cannot find or open the PDB file.
'scenceRecon.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp_win.dll'. Cannot find or open the PDB file.
'scenceRecon.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbase.dll'. Cannot find or open the PDB file.
The thread 0x27dc has exited with code -1073741515 (0xc0000135).
The thread 0x1f78 has exited with code -1073741515 (0xc0000135).
The program '[6608] scenceRecon.exe' has exited with code -1073741515 (0xc0000135) 'A dependent dll was not found'.```

而这个 .exe 错误

标签: c++opencv

解决方案


这是 Windows API 框架的常见模式。您安装/构建一些框架,该框架带有一组 INCLUDE、LIB 和 DLL 文件。您的代码包含头文件和与 DLL 存根 lib 文件的链接,以便进行编译。但是在运行时,无法找到依赖的 DLL,因为它们不在您的 PATH 中(或与 EXE 位于同一文件夹中)。

该对话框实际上是在告诉您错误。将 ceres-debug.dll 复制到与 EXE 相同的文件夹中。或者最好,如上所述,只需确保包含 ceres-debug.dll 的任何文件夹都在您的 PATH 环境变量中。通过更新 PATH,您可能会解决您的程序或 ceres-debug.dll 所依赖的附加 DLL 的许多后续错误。

说得通?

此外,“DLL 搜索顺序”的快速 google 有几篇很好的文章来解释这个主题:https ://docs.microsoft.com/en-us/windows/desktop/Dlls/dynamic-link-library-search-order


推荐阅读