Hello. Although I consider myself an experienced programmer (lead programmer of 2 commercially released games), I feel lost now that I have started using C++ for my next project.
Right now I want to create a class to read/encrypt/decrypt JSON-like text-based data files (a custom format I have designed for my needs). Let's say it's called Class1, and it also uses Class2 and Class3. All have separate headers and sources (.h & .cpp). Class1.h contains #include Class2.h
and #include Class3.h
.
Now, to use Class1 in a project of mine I have to #include Class1.h
and manually add Class1.cpp to my project (I am using Visual C++ Express 2008). But AFAIK this won't compile; I also have to manually add Class2.cpp and Class3.cpp to my project, too.
Here are my questions :
1) For every new project that I want to use Class1, I have to manually add all 3 source files. This can become very tedious if I have hundreds of similar classes. Is there a standard way to automate this process?
2) Shouldn't there be a way to automatically add a XY.cpp source file to a project when XY.h is included somewhere in the code?
Thank you for your time. Please forgive me for my ignorance.