如何停止IntelliSense PCH警告? [英] How do I stop an IntelliSense PCH Warning?

查看:4539
本文介绍了如何停止IntelliSense PCH警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一些头文件没有包含,所以我收到这个消息在Visual Studio 2010:

A few of my header files have no includes, so I receive this message in Visual Studio 2010:

IntelliSense: PCH warning: cannot find a suitable header stop location.  An intellisense PCH file was not generated.

如果我添加一个标题,例如:

If I add a single header, for instance:

#include <iostream>

它消失。如何阻止此错误显示,而不添加(可能未使用)include>

It disappears. How can I stop this error from showing without adding (potentially unused) include>

推荐答案

添加 #pragma

Add #pragma once at the start of the file.

这将导致您的源文件在一次编译中只包含一次,因此编译器将满足并且不需要额外的 #include

It will cause your source file to be included only once in a single compilation, therefore the compiler will be satisfied and won't require additional #include

这篇关于如何停止IntelliSense PCH警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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