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

  • 質問

  • 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.
    2008年5月22日 16:43

すべての返信

  • /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.
    2008年5月22日 17:28
    モデレータ
  • 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!
    2008年5月22日 18:09
  • 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!

    Steve
    2008年6月5日 21:09
  •  I met the same issue too...
    2008年8月26日 1:22
  • 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.
    • 回答の候補に設定 Dwight6531 2008年9月14日 22:41
    2008年9月14日 22:40
  • You'll probably also have to REBUILD the Solution after making the recommended project property change. Good luck.

    2008年9月14日 22:44
  • 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

    Vaclav

     

     

     

    2010年7月14日 20:42
  • Dwight6531 has it.

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

    Thank you, Dwight.

    2011年9月20日 3:01
  • I met the same issue. Although cleaning and rebuilding the solution will be ok, I don't knon why.
    2011年12月18日 14:06
  • 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.


    • 編集済み mak_july 2011年12月22日 16:32
    2011年12月21日 23:19
  • 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.

    Vaclav

    2012年8月15日 7:04
  • 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,


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

    See:
    https://connect.microsoft.com/VisualStudio/feedback/details/2351122/still-c1xx-fatal-error-c1027-inconsistent-values-for-ym-between-creation-and-use-of-precompiled-header

    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.

    Greetings.

    2016年2月18日 9:40
  • Try to disable precompiled headers in your project. If build is too slow - get a SSD. This _is_ an option in 2016.

    --pa

    2016年2月18日 12:01
  • I fixed this problem by disabling Avast from my PC.

    I hope it was your problem.

    Nicolas

    2016年3月3日 9:19
  • 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.
    2019年10月14日 10:07