Question about "stdafx.h"
-
Hi guys, I downloaded a zip utility source code. When I used it in my program I received:
..\Zip_Utils\zip.cpp(2992) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
I have the source. Of course, I can easily add '#include "stdafx.h"', but that is not the point. The question is: what is so special of "stdafx.h" that require including it in every .cpp that I add??? P.S. I don't know does it matter, but I'm writing in VS2005 in C++ for Windows Mobile 5.0, native, without STL, WTL, MFC.
-
Hi guys, I downloaded a zip utility source code. When I used it in my program I received:
..\Zip_Utils\zip.cpp(2992) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
I have the source. Of course, I can easily add '#include "stdafx.h"', but that is not the point. The question is: what is so special of "stdafx.h" that require including it in every .cpp that I add??? P.S. I don't know does it matter, but I'm writing in VS2005 in C++ for Windows Mobile 5.0, native, without STL, WTL, MFC.
akirilov wrote:
The question is: what is so special of "stdafx.h" that require including it in every .cpp that I add???
Because it's the key to using the precompiled header (.pch) file. The bigger question is how was the project's author able to compile the project without making the changes you've had to?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
akirilov wrote:
The question is: what is so special of "stdafx.h" that require including it in every .cpp that I add???
Because it's the key to using the precompiled header (.pch) file. The bigger question is how was the project's author able to compile the project without making the changes you've had to?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
Because it's the key to using the precompiled header (.pch) file.
So I have to include "stdafx.h" in every .cpp that I'm using? Than probably I have to start reading about precompiled header (.pch) file...akirilov wrote:
So I have to include "stdafx.h" in every .cpp that I'm using?
Yes, if that's the way the project has been configured. You can, however, turn it off for individual files (e.g., C files).
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
Hi guys, I downloaded a zip utility source code. When I used it in my program I received:
..\Zip_Utils\zip.cpp(2992) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
I have the source. Of course, I can easily add '#include "stdafx.h"', but that is not the point. The question is: what is so special of "stdafx.h" that require including it in every .cpp that I add??? P.S. I don't know does it matter, but I'm writing in VS2005 in C++ for Windows Mobile 5.0, native, without STL, WTL, MFC.
See the FAQ: 2.5 I added some source files I got from someone else into my project and the compiler gives the error "C1010: unexpected end of file while looking for precompiled header directive." Why? [^]
--Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ "That's what's great about doing user interface work. No matter what you do, people will say that what you did was idiotic." -- Raymond Chen
-
See the FAQ: 2.5 I added some source files I got from someone else into my project and the compiler gives the error "C1010: unexpected end of file while looking for precompiled header directive." Why? [^]
--Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ "That's what's great about doing user interface work. No matter what you do, people will say that what you did was idiotic." -- Raymond Chen