Fatal Error C1854
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: Fatal Error C1854

  1. #1
    Join Date
    Jan 2005
    Location
    Clemson, South Carolina
    Posts
    651

    Angry Fatal Error C1854

    Can someone please translate what MSDN is trying to tell me about this error? I didn't see any entries in the forums about this.
    error C2146a : syntax error : nebulizer stained in the tower floppy apple rider. Go rubble in flee smite. Bleeble snip snip.

    Documentation says: error C2146a - This means there is an error somewhere in the course of human endeavor. Fix in the usual way.

  2. #2
    Join Date
    Jul 2002
    Posts
    2,505

    Re: Fatal Error C1854

    high among the clouds
    Black Wing sparrow
    trembling and alone soars
    proudly above the ground

  3. #3
    Join Date
    Jan 2005
    Location
    Clemson, South Carolina
    Posts
    651

    Re: Fatal Error C1854

    LOL. That sounds about right.

    While I appreciate the humor, I'm afraid it leaves me no closer to understanding the problem. What is a "fatal error C1854"?

    All MSDN says is:

    cannot overwrite information formed during creation of the precompiled header in object file: 'filename'


    You specified the /Yu (use precompiled header) option after specifying the /Yc (create precompiled header) option for the same file. Certain declarations (such as declarations including __declspec dllexport) make this invalid.
    error C2146a : syntax error : nebulizer stained in the tower floppy apple rider. Go rubble in flee smite. Bleeble snip snip.

    Documentation says: error C2146a - This means there is an error somewhere in the course of human endeavor. Fix in the usual way.

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    5,927

    Re: Fatal Error C1854

    You specified the /Yu (use precompiled header) option after specifying the /Yc (create precompiled header) option for the same file.
    Well, did you? And if you did, what for?
    Best regards,
    Igor

  5. #5
    Join Date
    Jul 2002
    Posts
    2,505

    Re: Fatal Error C1854

    Quote Originally Posted by paradoxresolved View Post
    LOL. That sounds about right.
    Your post is so short, that C2146a looks like part of the question, so I did my best to answer it My mistake...
    Generally, when precompiled headers are used, stdafx.cpp has "Create precompiled header" parameter, and all other source files have "Use precompiled header" with stdafx.h. Any other combination is incorrect.
    stdafx.cpp is compiled first, and during this compilation all h-files included to it are scanned, and precompiled header (.pch) is created. This allows fast compilation of all other files, since information from h-files can be extracted from .pch file.
    Last edited by Alex F; December 24th, 2011 at 01:41 PM.

  6. #6
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,055

    Re: Fatal Error C1854

    Quote Originally Posted by Alex F View Post
    Your post is so short, that C2146a looks like part of the question
    I read it that way too. The sig just made the post look like some kind of nutty ramble, not a real question.

  7. #7
    Join Date
    Jan 2005
    Location
    Clemson, South Carolina
    Posts
    651

    Re: Fatal Error C1854

    Well, did you? And if you did, what for?
    Sadly, I wish I could answer that. I'm not even sure where to find these parameters. Er, well, I see /Yu, but I don't know where the other is. The entire thing worked until one particular build and all the sudden it started complaining. I don't know what triggered it. I wish I remembered changing things.

    What does stdafx stand for? And it has a parameter in it that creates a precompiled header file of all the other background header files?
    error C2146a : syntax error : nebulizer stained in the tower floppy apple rider. Go rubble in flee smite. Bleeble snip snip.

    Documentation says: error C2146a - This means there is an error somewhere in the course of human endeavor. Fix in the usual way.

  8. #8
    Join Date
    Jul 2002
    Posts
    2,505

    Re: Fatal Error C1854

    Project - Properties - Configuration Properties - C/C++ - Precompiled Headers.
    Create/use precompuled header: /Yu
    Create/use pch through file: stdafx.h
    Precompiled header file: $(IntDir)\$(TargetName).pch

    Right-click on every .cpp file, except stdafx.cpp - it should have the same properties.
    Right-click stdafx.cpp. It should have these properties:
    Create/use precompuled header: /Yc
    Create/use pch through file: stdafx.h
    Precompiled header file: $(IntDir)\$(TargetName).pch

    To see full command line, used for compilation, open file BuildLog.htm - many problems can be solved by reading this file. It contains full cl.exe command line for every compiled file.
    Last edited by Alex F; December 25th, 2011 at 07:27 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center