Currently I have some shared class files (.cpp and .h) which I include them in around 20 Projects. Currently I have to include them in all of the projects.
So if I get some business requirements and I change some of the shared (.cpp or .h) files I have to include them in all the 20 Projects which is kind of tedious.
Is there a way where I can create a shared dll or library and include it all of my projects? So if I have to change it, I just have to change it once and then just Add Reference to include that dll or library which contains all the shared (.cpp, .h) files.
I am using VS2012 for VC++.
2
This would be an appropriate use of a shared library. The difference will be that you will need to include a header file and link to the library versus including the headers and cpp files. However, the advantage is that you can build the library once and link to it once rather than having to build the the same code with every project. If you only add classes to the library that don’t change much, which are used commonly throughout your code, it will also help to increase the modularity and stability of your programs.
2