Original Post
I'm making a game that has several projects in it, all except one being libraries (like Graphics or AI), the remaining one being the actual game. I am currently re-structuring all the projects since I was using pre-compiled headers wrong. My plan is to have 3 main files for each library: pre-compiled, core, and include. Core would have all the enums, #defines, and consts for that library. Include would have all the .h, so that if another library needs this library, all it has to do is include this file. This file will include the core file. Pre-compiled would have all the c/c++/stl/other libraries needed, like windows.h or , and math library. This file will include the core file. The main thing about this design is that I want the include file to be as clean as possible, not including anything included in the pre-compiled, that way if another library includes this file, then it wouldn't get all the extra garbage (for lack of better word). The main issue that i have is that some classes require vector or types from the math library as member variables, but its not defined in the .h two fixes that i see are: 1) Include the pre-compiled in the .h, which means that the pre-compiled will be the include, which then will be on all the libraries, killing my compile time. 2) Include the library in the .h, defeating the purpose of having it in the pre-compiled. Another possible fix is forward declarations, but how do i forward declare a std::vector? this seems too complicated, and more of a hack than anything. Is there a better solution to my design issue that anyone can help me with?