如何创建现有C项目的DLL文件

如何创建现有C项目的DLL文件

本文介绍了如何创建现有C项目的DLL文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个C项目正在生成一个.exe作为输出.由于我需要创建现有项目的DLL文件,因此任何一个plz都能为我提供帮助.

Hi,
I am having a C project which is generating an .exe as output.Since i require to create a DLL file of the existing project so can any one plz help me.Thanks in advance. sorry fr inappropriate English.

推荐答案

LIBRARY   CDLL
EXPORT

Fun_1
Fun_2



这将导出Fun_1& Fun_2,没有名称修改.



This will export Fun_1 & Fun_2 without name mangling.


__declspec(dllexport) void __cdecl Fun1();



现在,转到项目"菜单,选择"项目属性".

在配置属性中->一般->配置类型为动态库(.dll)

编译代码,您将在输出目录中找到创建的.dll和.lib文件.

问候



Now, go to Project menu, select Project properties.

In Configuration Properties --> General --> Configuration Type as Dynamic Library (.dll)

Compile your code, you will find .dll and .lib file created in your output directory.

Regards


这篇关于如何创建现有C项目的DLL文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 06:48