开发者

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 u开发者_高级运维sing 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜