预编译头和MSBuild [英] Precompiled Header and MSBuild

查看:399
本文介绍了预编译头和MSBuild的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个预编译头,需要包含在我的项目中每个.cpp的顶部。我恐怕我会浪费很多时间解释和修复在同事代码。



有一个MSBuild步骤,我可以做#在所有我的.cpp文件的顶部包含stdafx.h,所以它不需要手动完成。

解决方案

您有编译器选项 / 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.

这篇关于预编译头和MSBuild的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆