windows 将lib+头文件转换为DLL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/896949/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 12:31:48  来源:igfitidea点击:

Convert lib + header file to DLL

c++cwindowsdll

提问by Robbert Dam

I have a library (lib file + .h header file). I like to turn it into a DLL so I can easiliy use it in VB6. Is there a convenient way to do this?

我有一个库(lib 文件 + .h 头文件)。我喜欢把它变成一个 DLL,这样我就可以在 VB6 中轻松使用它。有没有方便的方法来做到这一点?

回答by iain

Simply include the header file an a .def file in a new dll project and link it with the static lib.

只需在新的 dll 项目中包含一个 .def 文件的头文件,并将其与静态库链接。

The details of how to export symbols with a def file are here http://msdn.microsoft.com/en-us/library/d91k01sh(VS.80).aspx

如何使用 def 文件导出符号的详细信息在这里http://msdn.microsoft.com/en-us/library/d91k01sh(VS.80).aspx