How to compile a cpp to a dll in visual studio 201

2019-04-13 00:36发布

问题:

I have a cpp which depends on couple of headers in the same folder. I need to compile this cpp to a dll. How do I do it in visual studio 2010 expresS?

I found few articles on web for visual studio 2008 but I could not use it in 2010. Any pointers would be highly appreciated. Btw, I am a java programmer. CPP is all new to me, I am compiling some one else's cpp to dll.

Thanks, Abi

回答1:

Right-click on your project in the Solution Explorer, and select Properties.... Under Configuration Properties -> General there's an option called Configuration Type. If you change it to Dynamic Library (.dll), your project will generate a DLL when it is built.



回答2:

As a start point, you can use "Create New Project from Existing Code" as described here - specify that you want a DLL project when prompted.

Once you have a project in place that encapsulates your CPP code file, you can find other info on specific project settings in MSDN, or post new questions as you need to.