问题描述
有些事情我不明白,当谈到链接...我正在使用第三方库(GEOS库)编写程序。这个程序对geos.lib有一个依赖,但仍然需要geos.dll来运行。
There are things that I don't understand when it comes to linking... I'm writing a program using a 3rd party library (the GEOS library). This program has a dependency to geos.lib but still needs geos.dll to run.
我阅读了,我想我理解静态和动态库之间的区别。我不明白为什么我静态链接库时仍需要一个dll。
I read this question, I think I understand the difference between static and dynamic libraries. What I don't understand is why I still need a dll when I statically link a library.
推荐答案
它不是静态链接。 .lib只是一个存根库,在Windows上的.dll中绑定。也就是说,你在编译时链接到.lib,然后在运行时它会去寻找.dll。
It's not statically linked. The .lib is just a stub library that binds in the .dll on windows. That is, you link with the .lib at compile time, and then at runtime it will go looking for the .dll.
这篇关于程序静态链接到库,但仍需要dll运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!