Click here to Skip to main content
15,905,233 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: #include "everything.h" Pin
PJ Arends6-Nov-01 9:31
professionalPJ Arends6-Nov-01 9:31 
GeneralRe: #include "everything.h" Pin
Jamie Hale6-Nov-01 9:36
Jamie Hale6-Nov-01 9:36 
GeneralRe: #include "everything.h" Pin
DanYELL6-Nov-01 13:21
DanYELL6-Nov-01 13:21 
GeneralRe: #include "everything.h" Pin
Steen Krogsgaard6-Nov-01 22:20
Steen Krogsgaard6-Nov-01 22:20 
GeneralRe: #include "everything.h" Pin
Tomasz Sowinski7-Nov-01 0:48
Tomasz Sowinski7-Nov-01 0:48 
GeneralRe: #include "everything.h" Pin
Jamie Hale7-Nov-01 4:23
Jamie Hale7-Nov-01 4:23 
GeneralRe: #include "everything.h" Pin
Tomasz Sowinski7-Nov-01 7:19
Tomasz Sowinski7-Nov-01 7:19 
GeneralRe: #include "everything.h" Pin
Jamie Hale7-Nov-01 7:51
Jamie Hale7-Nov-01 7:51 
Despite the fact that there's absolutely nothing of interest to any of our competitors in our stdafx.h file, posting it would likely be a breach of my contract and hence a Bad Thing(TM).

But no, I'm not kidding. Before I moved everything around, there were about a dozen includes in each file in the project (header and source). So it probably ended up including everything anyways... But one post recommend I put everything in the stdafx.h to take advantage of the MS precompiled header stuff, and holy crap, our build time jumped from about 4 minutes to about 40 seconds.

And of course now, when I make even minor changes to one of the headers, it has to recompile everything.

I understand now style-wise that it's not a good idea, and I'm really looking forward to reading that book you recommended (the reviews make it sound like it's the book I've been looking for for a few years). But could you post a suggested alternative?

It looks like I have 3 options:
1) Put everything in the stdafx.h file and suffer the long and finicky builds.
2) Have each source file include the files that it needs (in the order it needs them) and suffer from each source file having potentially dozens of includes that all have the be in the right order. Build times would be more reasonable.
3) Have each header file have its own includes for specific files that it needs. Have each source file include what it needs above and beyond what comes in through the includes in the included headers. This is clearer than 2 and faster than 1, but it's not as pretty as I would like.

Can it get prettier?

J
GeneralRe: #include "everything.h" Pin
Tomasz Sowinski7-Nov-01 8:12
Tomasz Sowinski7-Nov-01 8:12 
GeneralRe: #include "everything.h" Pin
Mukkie7-Nov-01 9:30
Mukkie7-Nov-01 9:30 
Generalread the color Pin
6-Nov-01 8:58
suss6-Nov-01 8:58 
GeneralRe: read the color Pin
Nish Nishant6-Nov-01 9:08
sitebuilderNish Nishant6-Nov-01 9:08 
GeneralRe: read the color Pin
Christian Graus6-Nov-01 10:07
protectorChristian Graus6-Nov-01 10:07 
GeneralReboot windows 95 machines Pin
RobJones6-Nov-01 8:54
RobJones6-Nov-01 8:54 
GeneralRe: Reboot windows 95 machines Pin
Nish Nishant6-Nov-01 9:01
sitebuilderNish Nishant6-Nov-01 9:01 
GeneralRe: Reboot windows 95 machines Pin
RobJones6-Nov-01 9:06
RobJones6-Nov-01 9:06 
GeneralImage Acquisition Pin
Chambers6-Nov-01 7:15
Chambers6-Nov-01 7:15 
GeneralRe: Image Acquisition Pin
Chris Losinger6-Nov-01 7:21
professionalChris Losinger6-Nov-01 7:21 
GeneralRe: Image Acquisition Pin
#realJSOP6-Nov-01 7:46
professional#realJSOP6-Nov-01 7:46 
GeneralRe: Image Acquisition Pin
Chambers7-Nov-01 2:25
Chambers7-Nov-01 2:25 
GeneralRe: Image Acquisition Pin
Chris Losinger7-Nov-01 2:49
professionalChris Losinger7-Nov-01 2:49 
GeneralRe: Image Acquisition Pin
Chambers7-Nov-01 5:00
Chambers7-Nov-01 5:00 
GeneralImage Color Management (ICM) Pin
6-Nov-01 7:03
suss6-Nov-01 7:03 
GeneralLog deletes in BoundsChecker Pin
peterchen6-Nov-01 7:00
peterchen6-Nov-01 7:00 
Generalsys/socket.h Pin
6-Nov-01 5:42
suss6-Nov-01 5:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.