Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error C1010 1

Status
Not open for further replies.

AMosmann

Programmer
May 27, 2003
82
DE
Sorry, must be simple, but I do not know:

What are possible reasons for
Error C1010: Unexpected end of file while searching precompiled header?

I used 2 empty files, let me say [tt]f.h[/tt] and [tt]f.cpp[/tt], put it into project and wanted to rebuild it, and this error occurs. Why? What is the minimal text I have to put into such files?



Greetings Andreas
 
in the .cpp file try this as the first include
Code:
#include "stdafx.h"

-pete
 
Press Alt+F7 to access the project properties, and turn off precompiled headers.
 
Thx!

Pete:
it worked, but I do not know, why. Any explainations?

sethmcdoogle:
sorry, did not work. I read wrong, did not search for precompiled header, but for directive for precompiled headers ...

[cheers]


Greetings Andreas
 
Well it’s a semi-long story. So the typical number of library header files used in VC++ apps is huge. This promotes the use of pre-compiled headers to speed up builds.

VC++ wizards generate a single header file (stdafx.h) from which all library headers are included. Also the wizard generates project settings that tell the compiler to use the pre-compiled headers for every .cpp file in the project. This is the default since it is assumed that most of your .cpp files will use some of the library headers and this way you don’t have to compile them during each build. In fact if you use the wizard to create a new class it will place the include for stdafx.h in the .cpp for you.

So if your going to use any of the library headers you want stdafx.h included. On the occasion where you are building a generic (non Win32 dependent) set of files you can leave stdafx.h out and turn off the compiler setting for using the pre-compiled headers on that specific .cpp file rather than turning it off for the entire project and causing build time to skyrocket.

I hope that makes some sense.


-pete
 
thanks a lot, was a great help for understanding
[bigsmile]

Greetings Andreas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top