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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

error 3
msxml sample compilation 4
Compiling C and C++ 2
My Hello World failed! 8
precompiled headers 1
MapiRule error 3
Create a C/C++ dll and call it from C# 1
Compilation problem 1

Back
Top