Visual C ++的“强制包含”选项 [英] Visual C++ 'Force Includes' option
问题描述
我刚刚遇到一个Visual C ++选项,允许你强制文件包含 - 这是当我看到一些代码缺少一个 #includeStdAfx。
I have just come across a Visual C++ option that allows you to force file(s) to be included - this came about when I was looking at some code that was missing a #include "StdAfx.h"
on each .cpp file, but was actually doing so via this option.
该选项可以在高级选项卡上找到
The option can be found on the Advanced C/C++ Configuration Properties page and equates to the /FI compiler option.
此选项可以证明非常有用,
This option could prove really useful but before I rush off and start using it I thought I'd ask if there are any gotchas?
推荐答案
我不鼓励/ FI MSDN 说它叫/ FI。不知道我是否看着正确的页面,虽然),只是因为人们或者你自己读文件没有注意到头是神奇地包括反正。
I would discourage from /FI (MSDN says it's called /FI . Not sure whether i looked at the right page though), simply because people or yourself reading the files don't notice a header is magically included anyway.
你可以确定这将导致很多调试时间,想要弄清楚哪里的特定宏来自于,即使没有# include
行在文件的顶部。
You can be sure this will cause much debugging time for someone that wants to figure out where specific macros come from, even though there are no #include
lines at the top of the file.
这篇关于Visual C ++的“强制包含”选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!