Jump to content
  • Advertisement
Sign in to follow this  
chadsxe

Design Question

This topic is 3992 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a question about design. I have project that is set up to ouput a static lib. Then I naturally setup another project and tie into that lib. In the project that compiles to a lib I have a "cGlobal" header files that houses all header includes...example // Standard Includes #include <windows.h> #include <map> #include <string> #include "tchar.h" //System includes #include "cApplication.h" #include "cStateManager.h" //Graphics includes #include "cGraphics.h" #include "cText.h" #include "cTexture.h" My concern is that I should not be including the "Standard Includes" inside this "header" file that is in the static lib project. Reason being is because the person who is going to tie into this .lib will have no idea as to what #includes (s) i have actually included. Well, at least this is my thinking. Do you think I should remove my "Standard Includes" from my "cGlobal" header file and put them in the actual classes that use them. That way the new project that uses the lib will be free to add includes as needed. One inportant thing to consider is the fact that for the "new" project to make use of the lib it has to include this one call to "cGlobal". Ha, hope that made sense. Just looking for some brain picking. Regards Chad

Share this post


Link to post
Share on other sites
Advertisement
You may not remove those includes which your library needs to be built.
As for the other includes, those you don't need, you may remove them.

The way you ask your question lets me think that you slightly misunderstood what #include does. The fact that you leave or remove them will have no impact on whether someone who will link to your library will need to add these includes to his source files, because includes are compile time stuff whereas you library is link time, so even in the case someone uses some code defined in your .lib, he will have to use the corresponding declarations in his code (with includes) so that the compiler knows about them.

What someone who is linking to you library will not have to do is link statically with the stuff that you already have statically linked into your library.

JA

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!