How to convert a static library project into a dll project in VS2005

孤街浪徒 提交于 2020-01-02 12:22:22

问题


When I create a project in vs2005. I can also create Win32->Win32Project. I can choose "console application" or "dll" or "static library"

if I created a static library project. How can I convert it to dll project. I found in setting panel of the created project. General->Configuration Type, I can switch Static Library(.lib) to DLL However, after this setting. I does get a dll. but I do not have a lib with it. and I can not use it in other project. How to convert a static library project into a dll project in VS2005 many thanks!


回答1:


The way I've done this, and this may not be the "best" way, was to create a new project with the right settings (DLL in this case) and then create the stub methods with the wizards that I want to expose from the static library.

Then you have two choices, you can leave the real code in the static library and just have your stubs in the DLL call into the static library, or you can copy the code out of the static library project and retire the static library entirely.

The advantage of the first option is that you can support both the static library and the DLL without having to duplicate a lot of work. But if you can get rid of supporting the static library entirely the second option is probably better because you don't have to make changes in two different projects (adding the stub method in the DLL and the real code to the static lib) every time you want to add a new method/property. YMMV



来源:https://stackoverflow.com/questions/1972552/how-to-convert-a-static-library-project-into-a-dll-project-in-vs2005

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!