c1xx : fatal error C1027: Inconsistent values for /Ym between creation and use of precompiled header RRS feed

  • Question

  • I'm trying to port C++ applications that built with VS 2005 to VS 2008.  I'm using a build procedure that invokes VS from the command line many times using the devenv command.  On my own computer, I get the C1027 error building a project.  The same project works properly on other machines and works OK on my machine if I build it from inside the IDE.  Any suggestions for a fix or workaround?

    Second, what does this error message mean?  I can't find any documentation on the /Ym command line switch for the C++ compiler.
    Thursday, May 22, 2008 4:43 PM

All replies

  • /Ym is a GCC compiler option.  Rings a bell?  You probably need to clean up your makefiles.  It is some kind of undocumented option for VC, no idea what it does.
    Thursday, May 22, 2008 5:28 PM
  • I'm not using makefiles, just a vanilla solution file & vcproj files.  This project would probably keel over if it ever got a whiff of GCC!
    Thursday, May 22, 2008 6:09 PM
  • So how does one try to fix up this error? I got it as well and can't find that error code anywhere.

    And what makefiles?? I don't have any!

    Thursday, June 5, 2008 9:09 PM
  •  I met the same issue too...
    Tuesday, August 26, 2008 1:22 AM
  • I couldn't find any documentation either but after some poking around I was able to resolve it by:
    1) Going to Project Properties --> Configuration Properties --> C/C++ --> Precompiled Headers
    2) Changing it to "Not Using Precompiled Headers"

    If you're not doing something that requires precompiled headers, I think that should work for you.  I wish I had more explanation -- perhaps Microsoft will weigh in on the subject or at least add documentation for the C1027 fatal error.
    • Proposed as answer by Dwight6531 Sunday, September 14, 2008 10:41 PM
    Sunday, September 14, 2008 10:40 PM
  • You'll probably also have to REBUILD the Solution after making the recommended project property change. Good luck.

    Sunday, September 14, 2008 10:44 PM
  • My project worked (and compiled) normally.

    All of a sudden I am getting

    fatal error C1027: Inconsistent values for /Ym between creation and use of precompiled header

    I tried to clean the intermediate directory and also the precompiled headers. No luck. I did not use any /Ym switch.

    what can I do?


    Thanks in advance





    Wednesday, July 14, 2010 8:42 PM
  • Dwight6531 has it.

    I used the Create Precompiled Header (/Yc) option instead.

    Thank you, Dwight.

    Tuesday, September 20, 2011 3:01 AM
  • I met the same issue. Although cleaning and rebuilding the solution will be ok, I don't knon why.
    Sunday, December 18, 2011 2:06 PM
  • 1. check for viruses. it is 99% that your build environment is infected

    3. be sure you have enough disk space for %tmp%

    4. turn off /MP, set /Zm2000, set parallel builds to 1.

    • Edited by mak_july Thursday, December 22, 2011 4:32 PM
    Wednesday, December 21, 2011 11:19 PM
  • Changing to "Not Using Precompiled Headers is no option. When I do it, the project builds for hours. I do not have that much time.


    Wednesday, August 15, 2012 7:04 AM
  • Hello,

    Recently i have solved this problem.

    In my case the issue was because i have changed the second value (aka 20480) from SharedSection=1024,20480,768 in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems\Windows .

    Setting SharedSection to the default value solved the problem.

    Im my case (Win7) the second value must be 20480 .

    I hope this will help others to solve the issue.

    Thank you,

    Friday, January 15, 2016 11:47 AM
  • FYI, others (including me) encountered and reported the same problem to Microsoft. (Since it's unfortunately still exists.)


    As a VC team member explained: /Ym is an undocumented option. Its parameter is the memory address where PCH file is created and loaded. The PCH file needs to be created and later loaded at the same memory address, otherwise the compiler cannot use it. Normally this works fine.

    But when the compiler cannot load the PCH at its original creation address, for some reason, it reports the C1027 error message.

    Please upvote the above-mentioned ticket if you are still interested in.


    Thursday, February 18, 2016 9:40 AM
  • Try to disable precompiled headers in your project. If build is too slow - get a SSD. This _is_ an option in 2016.


    Thursday, February 18, 2016 12:01 PM
  • I fixed this problem by disabling Avast from my PC.

    I hope it was your problem.


    Thursday, March 3, 2016 9:19 AM
  • If anyone still facing this issue, passing parameter /Ym<value> fixed the issue for me. For example, /Ym500 /Zm500. I guess Ym is an undocumented parameter for msbuild.
    Monday, October 14, 2019 10:07 AM