when it’s implicit linking an dll (dynamic-link library) , the operating system will use the following algorithm for locating a DLL.
- The directory where the executable module for the current process is located.
- The current directory.
- The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
- The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
- The directories listed in the PATH environment variable.
when it’s explicit linking, one can specify the path to the dll file in the source c++ code.
reference
Application Specific Paths for DLL Loading
https://www.codeguru.com/cpp/w-p/dll/article.php/c99/Application-Specific-Paths-for-DLL-Loading.htm
应用程序如何找到DLL文件? - EverythingHere - 博客园
https://www.cnblogs.com/shangdawei/p/3537792.html
本文详细阐述了操作系统在隐式链接和显式链接情况下查找DLL文件的算法与路径,包括当前进程模块目录、当前目录、系统目录等,并提供了具体函数如GetSystemDirectory和GetWindowsDirectory的使用说明。
1224

被折叠的 条评论
为什么被折叠?



