A Stupid Compilation err

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I never practiced C++ development in VC++.net before. (only Unix)
what does the error:
d:\C++\UMath\UAlgebra.cpp(71): fatal error C1010: unexpected end of file
while looking for precompiled header directive

mean ?, and how do I fix it ?

Thank you !
 
How to fix it:

Add
#inlcude "stdafx.h"
as the first line of your file.

Background:
For faster compilation, VC++ provides precompiled headers.

The file stdafx.cpp which contains only the include directive for stdafx.h,
is compiled with /Yc"stdafx.h". When this file is compiled the compiler
builds it's table for macros, typedefs, ... and stores these tables into a
file named stdafx.pch. (AFAIK, this is done by just maping the compiler's
virtual memory into a file.)

All other files are by default compiled with /Yu"stdafx.h". This means they
expect the include line for stdafx.h as the first line and load the
definitions from stdafx.pch instead of really including stdafx.h and all
it's headers.

This can increase compilation time drastically.

Marcus Heege
 
Back
Top