views:

539

answers:

1

foo.cpp(33918) : fatal error C1854: cannot overwrite information formed during creation of the precompiled header in object file: 'c:\somepath\foo.obj'

Consulting MSDN about this gives me the following information:

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.

We are using dllexport and precompiled headers in this case. Have anyone encountered this before and know of any workaround? Any input to shed some light on this problem is greatly appreciated.

Thanks

+3  A: 

I think you can find the answer here: http://social.msdn.microsoft.com/forums/en-US/vclanguage/thread/b3aa10fa-141b-4a03-934c-7e463f92b2a5/

Basically, you need to set the stdafx.cpp file to "Create Precompiled Headers" and all the other .cpp files to "Use Precompiled Headers"

cspirz
It worked for me. Awesome, thanks.
gramm