且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

预编译头和MSBuild

更新时间:2023-09-18 10:00:58

您有编译器选项 / FI 路径名



可虚拟添加 #includepathname在文件的第一行。



注意:gcc的等价物是 -include path p>

I have a precompiled header that needs to be included atop each .cpp in my project. I fear that I will waste a lot of time explaining and fixing that in coworkers code.

Is there an MSBuild step that I can do to #include "stdafx.h" at the top of all my .cpp files so it dosen't need to do done manually?

You have the compiler option /FI pathname

which virtually add #include "pathname" at the first line of the file.

Note: the equivalent for gcc is -include path.