|
-
Oct 20th, 2002, 04:00 PM
#1
Thread Starter
Addicted Member
stdafx.cpp
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?
-
Oct 20th, 2002, 04:29 PM
#2
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)
-
Oct 20th, 2002, 04:40 PM
#3
Thread Starter
Addicted Member
Oh, thanks, I guess I'll leave it.
-
Oct 20th, 2002, 04:42 PM
#4
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 20th, 2002, 04:58 PM
#5
Thread Starter
Addicted Member
it MUST be in EVERY single one?
-
Oct 21st, 2002, 03:49 AM
#6
Yep. Every .cpp or .c file that is. Not in every .h file.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 21st, 2002, 06:39 AM
#7
Monday Morning Lunatic
Unless you turn off precompiled headers, in which case you don't need it.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 21st, 2002, 09:20 AM
#8
... if you don't turn it off stdafx.h must be the...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 21st, 2002, 11:58 AM
#9
Monday Morning Lunatic
Missed that But repeating it is still valid if you think about the responses...
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|