为什么我的动态库.dll 链接的时候明明选的是静态库lib,最后却依赖于其他.dll?
用VS2010 编写的动态库my.dll,
vs my工程->属性->链接器->常规:附加库目录选择的 我自己的lib文件夹,里面有my.dll 依赖的静态库 dpende1.lib,dpende2.lib
vs my工程->属性->链接器->输入:附加依赖项:填的是dpende1.lib,dpende2.lib
然后 配置:活动release 平台:活动Win32
生成my.dll 给python调用,报错OSError: [WinError 126] 找不到指定的模块。
用vs tool工具查看my.dll的依赖项:
(方法见:https://blog.csdn.net/lyncai/article/details/11784471)
显示的结果是:
D:\>dumpbin /dependents my.dll
Microsoft (R) COFF/PE Dumper Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file my.dll
File Type: DLL
Image has the following dependencies:
dpende1.dll
dpende2.dll
MSVCR100.dll
KERNEL32.dll
Summary
1000 .data
2000 .rdata
1000 .reloc
1000 .rsrc
9000 .text
D:\>
这是为什么呢? 我明明工程依赖的是lib库呀,这样一来,我要用这个my.dll还得拖家带口的带上 dpende1.dll, dpende2.dll才行?不是已经链接进到my.dll里面了吗?有谁知道该怎么弄吗?