程序静态链接到库,但仍需要dll运行 [英] Program statically linked to a library but still needs dll to run

查看:250
本文介绍了程序静态链接到库,但仍需要dll运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有些事情我不明白,当谈到链接...我正在使用第三方库(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运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆