“dll导出/导入”是什么意思? [英] What does `dll exporting/importing` mean?

查看:139
本文介绍了“dll导出/导入”是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑这个术语。我绝对不喜欢dll的上下文中的 export 这个词。原因只是因为我不明白是什么。我不知道在哪里寻找。



它在很多场合使用。




  • 从dll导出的DLL

  • 从共享库导出表




可以请任何人解释。这是什么意思?在任何其他情况下,其意义如何变化?什么是导出表? PE / ELF文件中的.text / .bss / .data部分是否类似。



为什么没有听说过 dll import ?如果这样的事情存在什么时候使用如果它不是太多,一个简单的例子也是很棒的。



请澄清,请各位使用简单的术语。我已经感到困惑。

解决方案

当一个函数暴露于其他程序使用。 dll的导出表是公开的功能列表和可用的地址。通常,dll包含一些导出用于公共消费的功能,以及其他未导出的功能 - 它们不能被其他dll或程序使用正常的方法调用,但可以在内部调用dll。 p>

你不会经常谈论dll import,因为dll导入不是一个单一的过程。当您链接到dll时,该dll导出的每个功能都将提供给您的dll,但是为了链接到dll,您通常需要一个.h文件来提供声明,而.lib文件提供了存根导出的函数的指针。这两个东西一起构成了dll 导入。但是,通过使用 LoadLibrary GetProcAddress 函数(相当于POSIX dlopen dlsym )。


I'm very confused with this terminology. I absolutely don't like the word export in the context of dll. Reason is only because, I don't understand what it is. I don't know where to look for either.

It is used in many occasions.

  • Exporting from a DLL
  • export table from a shared library
  • functions exported by dll.

Can any one please explain. What it means? In any other contexts, how does its meaning change? What is an export table? Is it like .text/.bss/.data section(s) in PE/ELF file?

Why didn't I ever hear about dll import? If such thing exists. When is it used. If its not too much, a simple example would also be great.

Please clarify and I kindly request everyone to use simple terminology. I'm already confused.

解决方案

A function is exported from a dll when it is exposed to other programs to used. The export table of a dll is the list of functions which are exposed and the addresses at which they are available. Typically, a dll contains some functions which are exported for public consumption, and other functions which are not exported--they can't be called by other dlls or programs using normal methods, but they can be called internally be the dll.

You don't often talk about "dll import" because dll importing is not a single process. When you link to a dll, every function exported by that dll is made available to your dll, but in order to link to a dll you generally need a .h file that gives you the declarations, and a .lib file that provides the stub pointers for the exported functions. These two things together constitute the dll import. However, it is possible to use dll functions without either of these things by using the LoadLibrary and GetProcAddress functions (equivalent to POSIX dlopen and dlsym).

这篇关于“dll导出/导入”是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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