When I make a new non-blank program this file is in the project but it only has one include which has a bit of code I can't even begin to understand...
So my question is: What is StdAfx meant for?
Printable View
When I make a new non-blank program this file is in the project but it only has one include which has a bit of code I can't even begin to understand...
So my question is: What is StdAfx meant for?
Stdafx is used for precompiled headers by MS Visual C++. If you include some headers in stdafx.h, and you include stdafx.h in every cpp file, then stdafx only has to be compiled once, which will speed up compile time.
You don't need stdafx.h/.cpp, you can delete both files. If you do that you must also turn precompiled headers off (project, settings, C++, cotegory: precompiled headers, not using precompiled headers)
Oh, thanks, I guess I'll leave it.
Just remember that if you don't turn it off stdafx.h must be the FIRST include in EVERY one of your .cpp files, else the file won't compile.
it MUST be in EVERY single one? :eek:
Yep. Every .cpp or .c file that is. Not in every .h file.
Unless you turn off precompiled headers, in which case you don't need it.
Quote:
...if you don't turn it off stdafx.h must be the...
Missed that :p But repeating it is still valid if you think about the responses...