开发者

can i use multiple PCH files in 1 project?

开发者 https://www.devze.com 2022-12-25 05:14 出处:网络
I want to use the PCH file to speed up the build, so i store the PCH file in a separate folder and reuse it when build the project later.

I want to use the PCH file to speed up the build, so i store the PCH file in a separate folder and reuse it when build the project later.

but I have some #import *.dll in my stdafx.h. so if something changed in the *.dll, the PCH file need be recreated.

my question is whether I can use multiple PCH files in 1 project,开发者_如何学JAVA so that i can put the import *.dll to another PCH and only recreate this one if something changed in *.dll.

thanks in advance :)


No, you can only include one pch file per cl.exe invocation.

It's a bummer but that's the way it is.


Yes you can set per cpp file which pch to use.

Just go to the .cpp file's properties and then go to the pre-compiled header tab. (Configuration Properties -> C/C++ -> Precompiled Headers) You can specify which pre-compiled header to use there.

You should only put things that don't change in your pre compiled headers though.

0

精彩评论

暂无评论...
验证码 换一张
取 消