关于使用cmake修改opencv源码的问题

Tianrrrran 2018-07-18 09:08:22
我按照网上的教程cmake,然后修改完opencv源码之后,把新生成的.dll文件,替换掉了以前相应路径下opencv 中的,dll文件,并且lib文件也一并替换了,但是我更改的代码似乎并没有运行,想问下是为什么。
还有就是我在cmake编辑的时候用的是VS2017,在更改和新生成.dll时用的也是VS2017,但是在替换完之后使用的是VS2015,会有影响吗?
...全文
174 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2018-07-19
  • 打赏
  • 举报
回复
学会使用depends.exe
yiyefangzhou24 2018-07-19
  • 打赏
  • 举报
回复
更改的什么代码没有运行?
赵4老师 2018-07-19
  • 打赏
  • 举报
回复
Dynamic-Link Library Search Order
A system can contain multiple versions of the same dynamic-link library (DLL). Applications can control the location from which a DLL is loaded by specifying a full path, using DLL redirection, or by using a manifest. If none of these methods are used, the system searches for the DLL at load time as described in this topic.

Standard Search Order
The dynamic-link library (DLL) search order used by the system depends on whether safe DLL search mode is enabled or disabled.

Windows Vista, Windows Server 2003, and Windows XP SP2: Safe DLL search mode is enabled by default. To disable this feature, create the HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode registry value and set it to 0. Calling the SetDllDirectory function effectively disables SafeDllSearchMode while the specified directory is in the search path and changes the search order as described in this topic.
Windows XP and Windows 2000 SP4: Safe DLL search mode is disabled by default. To enable this feature, create the SafeDllSearchMode registry value and set it to 1.

If SafeDllSearchMode is enabled, the search order is as follows:


The directory from which the application loaded.
The system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The current directory.
The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key.

If SafeDllSearchMode is disabled, the search order is as follows:


The directory from which the application loaded.
The current directory.
The system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key.
Note that versions of Windows prior to the ones listed at the beginning of this section do not support SafeDllSearchMode. For more information, see Legacy Search Order below.

Alternate Search Order
The standard search order used by the system can be changed by calling the LoadLibraryEx function with LOAD_WITH_ALTERED_SEARCH_PATH. The standard search order can also be changed by calling the SetDllDirectory function.

Windows XP/2000 and Windows 2000 Server: Changing the standard search order by calling SetDllDirectory is not supported until Windows XP SP1 and Windows Server 2003.

If you specify an alternate search strategy, its behavior continues until all associated executable modules have been located. After the system starts processing DLL initialization routines, the system reverts to the standard search strategy.

The LoadLibraryEx function supports an alternate search order if the call specifies LOAD_WITH_ALTERED_SEARCH_PATH and the lpFileName parameter specifies an absolute path.

Note that the standard search strategy and the alternate search strategy specified by LoadLibraryEx with LOAD_WITH_ALTERED_SEARCH_PATH differ in just one way: The standard search begins in the calling application's directory, and the alternate search begins in the directory of the executable module that LoadLibraryEx is loading.


If SafeDllSearchMode is enabled, the alternate search order is as follows:


The directory specified by lpFileName.
The system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The current directory.
The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key.

If SafeDllSearchMode is disabled, the alternate search order is as follows:


The directory specified by lpFileName.
The current directory.
The system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key.
The SetDllDirectory function supports an alternate search order if the lpPathName parameter specifies a path. The alternate search order is as follows:

The directory from which the application loaded.
The directory specified by lpPathName.
The system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is System32.
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable.
If the lpPathName parameter is an empty string, the call removes the current directory from the search order.

SetDllDirectory effectively disables safe DLL search mode while the specified directory is in the search path. To restore safe DLL search mode based on the SafeDllSearchMode registry value and restore the current directory to the search order, call SetDllDirectory with lpPathName as NULL.

Legacy Search Order

Versions of Windows earlier than the ones listed under Standard Search Order do not support the SafeDllSearchMode value. The DLL search order is as follows:


The directory from which the application loaded.
The current directory.
The system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key.
See Also
Dynamic-Link Library Redirection
LoadLibrary
LoadLibraryEx
SetDllDirectory
Side-by-side Components



Send comments about this topic to Microsoft

Build date: 8/15/2007
Tianrrrran 2018-07-19
  • 打赏
  • 举报
回复
引用 1 楼 zhao4zhong1 的回复:
学会使用depends.exe

depends如果要分析VS的工程,那么需要分析那个文件呢?我看百度教程说是需要可执行文件
Tianrrrran 2018-07-19
  • 打赏
  • 举报
回复
引用 1 楼 zhao4zhong1 的回复:
学会使用depends.exe

可否请老师详细说明一下呢?

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧