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

查看:154
本文介绍了程序静态链接到一个库,但仍然需要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天全站免登陆