Skip to main content
GameDev.net gamedev.net
🔒 Locked

linking dependencies (C++)

Started by jchmack Jul 4, 2008 at 5:58 AM 0 replies 750+ views
Original Post
jchmack
jchmack
Is there a way to find out what .cpp files need what header files? My project is starting to get really complicated and I am trying to de-couple a lot of these to improve compile times.
hh10k
hh10k
I guess one of the standard auto-dependency generators that are normally used with gcc would do the trick, but I'm not sure it will tell you what headers are actually *used*. My current strategy is to first strip out any unnecessary includes in the header files. If the definition of class A only uses pointers or references to class B, including B.hpp is not necessary. Avoid master include headers until they really provide fundamental definitions, like configuration preprocessor macros. Only when a cpp complains about a missing definition, you should add it in.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.