Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stdafx.h

Status
Not open for further replies.

peterworth

Programmer
Aug 18, 2004
80
GB
why do i have to include stdafx.h in all my cpp files, even though the code for many of them is potentially platform independant? i get a unexpected end of file while looking for precompiled header error if i dont include it..
 
Goto project settings and turn off precompiled headers.
Then the whole need for stdafx goes away.

--
 
so what do i lose from not including it? just windows functions and stuff?
 
It shouldn't contain anything as far as I know, its just a marker file which the precompiled header feature looks out for (so it knows when to stop).

If you've put some stuff in there already (ie windows stuff), then just leave the code as it is now, and just turn off the precompiled header feature (then stdafx is just a regular include file with no additional magic).

Files which don't need to include stdafx.h don't need to include it, since it is no longer a magic filename.

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top