简体   繁体   中英

Splitting classes out into DLLs using VS2008 C++

I've got a VS2008 C++ solution containing one project which is a Win32 console application. I have developed a few classes that I want to re-use in another project. Apart from copying the source files into new projects, what's the correct way to turn my classes into some sort of reusable component?

Should I be using a standard DLL, or a Class Library or what? I don't intend on using this in a .NET application, or using any of the Windows GUI components. They're just bog standard classes.

This used to be really easy to do in C#, you just make a new project and drag the files in, then update project dependencies. I think using .NET managed code has spoiled me slightly ;-)

You say that you were spoiled that in C# you can just drop the files in the new project. You can do the same for C++. For small stuff, this is what I prefer because of the simplicity. Otherwise you have the option of a static library (.lib) or a DLL, both of which have their own sets of nuances and complications that need justification. The simplest way is to copy the files to the new project, unless you have a reason why that won't work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM