Take the 2-minute tour ×

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

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
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 Sep 19 '10 at 8:51

Your Answer


