views:

24

answers:

1

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 ;-)

+1  A: 

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.

tenfour
I did try that earlier but evidently didn't choose the correct project type. I've just made this work by creating an empty project and changing it from being an Application to a Static Library.
Piku