如何编译形成DLL
我有示例项目代码。当我在 Visual C++ 中编译它时,它生成为 EXE。我想知道如何将最终输出更改为DLL形式。意思是,当我编译时,它变成了DLL。
I have sample project codes. When I compile it inside Visual C++, it produce as EXE. I would like to know, how can I change the final output to DLL form. Means that, when I compile, it become DLL.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
简而言之,动态链接库(DLL)是一个小程序的集合,可以在需要时被运行的可执行程序(EXE)调用。
例如,假设程序(exe)需要获取硬盘驱动器的可用空间。它可以调用包含带参数的函数和调用函数的DLL文件。然后DLL将告诉可执行文件可用空间。这使得可执行程序的大小更小,并且不必编写已经存在的函数
您可以在此处检查所需的步骤:如何创建简单的 Win32 DLL ?
In a nut shell, a dynamic link library (DLL) is a collection of small programs, which can be called upon when needed by the executable program (EXE) that is running.
E.g Suppose, it would be if the program (exe) needs to get the free space of your hard drive. It can call the DLL file that contains the function with parameters and a call function. The DLL will then tell the executable the free space. This allows the executable program to be smaller in size and not have to write the function that has already exists
You can check the required steps here : How to Create a Simple Win32 DLL ?
将其编译为DLL相对容易,即在“配置”->“配置”中设置“配置类型”。一般在项目属性中改为“动态链接库”。
然而,除非您也将入口点导出到 DLL 中,否则这不会有太大作用。
Compiling it as a DLL is comparatively easy, namely you set the "Configuration Type" in Configuration -> General in the project properties to "Dynamic Link Library".
However this isn't going to accomplish much unless you also export the entry point(s) into the DLL.
创建新项目时,在“新建项目”对话框中选择“类库”:
When you create a new project choose "Class Library" in the New Project dialog: