A Stupid Compilation err

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Clocker

    #1

    A Stupid Compilation err

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

    mean ?, and how do I fix it ?

    Thank you !
  • Marcus Heege

    #2
    Re: A Stupid Compilation err

    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

    "Clocker" <Clocker@discus sions.microsoft .com> wrote in message
    news:EF044F17-A7D0-4D5C-939C-C2D804CFFFB3@mi crosoft.com...[color=blue]
    > Hello,
    > I never practiced C++ development in VC++.net before. (only Unix)
    > what does the error:
    > d:\C++\UMath\UA lgebra.cpp(71): fatal error C1010: unexpected end of file
    > while looking for precompiled header directive
    >
    > mean ?, and how do I fix it ?
    >
    > Thank you ![/color]


    Comment

    Working...