[Tip: pch]How to reuse pch file on another pc?

本文解答了如何在不同PC间复用预编译头文件(PCH)的问题。Microsoft官方未正式支持此操作,但在遇到编译错误C1027时,建议使用Incredibuild解决内存地址一致性问题。

How to reuse pch file on another pc?
MS doesn't officially announcethat the pch files that are produced on on pc can be reused on anyother pcs. But MS suggests you can use Incredibuild to do this.
You will receive below compile error:
fatal error C1027: Inconsistent values for /Ym between creation and use of precompiled headers
Answer from MS:
/Ym is an internal switch that is used between the driver (cl.exe) andthe parsers (c1.dll and c1xx.dll) it is used to pass the address of thecontiguous memory that has been reserved by cl.exe for the PCH. We dothis reservation in the driver so that we can reserve the memory asearly as possible in the process before too many DLLs have been loaded(and have grabed the memory we need). The compiler requires that thePCH is loaded at exactly the same address during a /Yu build as it wasduring a /Yc build -- the C1027 error you are seeing implies that in a/Yu build the driver was not able to reserve the memory at the requiredaddress.

 

Note: we do notofficially support using a PCH on different machine from the one onwhich it was created. Even if they machines are 100% identical it stillcan not be guaranteed that the preferred PCH address will be the sameon both machines.

I would suggest talking to Incredibuild -- they may be able to help you solve this issue.

Jonathan Caves
Visual C++ Compiler Team

转载于:https://www.cnblogs.com/taoxu0903/archive/2010/03/27/1698549.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值