windows中搜索dll的顺序

一般的顺序就是:  exe所在目录--> 当前目录 --> windows system 目录 -->   windows 目录  --> $PATH变量所规定的路径

具体的描述可以参看这里: windows MSDN   。 

 

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

  1. The directory from which the application loaded.
  2. The system directory. Use the GetSystemDirectory function to get the path of this directory.
  3. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
  4. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
  5. The current directory.
  6. 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 App Paths key is not used when computing the DLL search path.

 

而linux中的搜索路径一般为: 首先 编译链接中的 -L参数, 然后是检查$LD_LIBRARY 路径, 如果还未发现,就会检查/etc/ld.so.conf当中设定的库的路径,

最后是检查 --->   /lib   -->  /usr/lib 或者下的默认库;

转载于:https://www.cnblogs.com/superniaoren/p/3341397.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值