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.
Printable View
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.
high among the clouds
Black Wing sparrow
trembling and alone soars
proudly above the ground
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:
Quote:
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.
Well, did you? And if you did, what for?Quote:
You specified the /Yu (use precompiled header) option after specifying the /Yc (create precompiled header) option for the same file.
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.
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.Quote:
Well, did you? And if you did, what for?
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?
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.