.dll、.lib、.h 文件之间有什么区别?

2023-08-29C/C++开发问题
2

本文介绍了.dll、.lib、.h 文件之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

为什么我应该在项目中包含一些 *.lib、.h 或一些其他文件?这些东西是干什么用的?

Why in a project should I include some *.lib, .h or some other files? And what are these things used for?

推荐答案

  • .h:头文件,它是一个包含声明的源文件(与包含实现的 .cpp、.cxx 等相反),

    • .h: header file, its a source file containing declarations (as opposed to .cpp, .cxx, etc. containing implementations),

      .lib:静态库可能包含代码或只是指向动态库的链接.无论哪种方式,它都是与程序链接的编译代码.静态库在链接时包含在您的 .exe 中.

      .lib: static library may contain code or just links to a dynamic library. Either way it's compiled code that you link with your program. The static library is included in your .exe at link time.

      .dll:动态库.就像静态文件一样,但您需要将它与 .exe 文件一起部署,因为它是在运行时加载的.

      .dll: dynamic library. Just like a static one but you need to deploy it with your .exe file because it's loaded at run time.

      这篇关于.dll、.lib、.h 文件之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

      The End

相关推荐

无法访问 C++ std::set 中对象的非常量成员函数
Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)...
2024-08-14 C/C++开发问题
17

从 lambda 构造 std::function 参数
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)...
2024-08-14 C/C++开发问题
25

STL BigInt 类实现
STL BigInt class implementation(STL BigInt 类实现)...
2024-08-14 C/C++开发问题
3

使用 std::atomic 和 std::condition_variable 同步不可靠
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)...
2024-08-14 C/C++开发问题
17

在 STL 中将列表元素移动到末尾
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)...
2024-08-14 C/C++开发问题
9

为什么禁止对存储在 STL 容器中的类重载 operator&()?
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)...
2024-08-14 C/C++开发问题
6