且构网

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

C++ Visual Studio 2017 Intellisense 标记错误但构建成功

更新时间:2023-02-12 19:23:32

IntelliSense 限制

IntelliSense 在以下情况下不适用于 C++ 项目:

IntelliSense does not work in C++ projects under the following circumstances:

  • 光标在代码注释中.

  • The cursor is in a code comment.

您正在编写字符串文字.

You are writing a string literal.

光标上出现语法错误.

该解决方案由托管 C++ 的语法或早期的 C++ 托管扩展语法组成.

The solution consists of either the syntax for managed C++, or the earlier Managed Extensions for C++ syntax.

当您使用 #include 指令多次引用一个头文件时,不完全支持 IntelliSense,并且该头文件的含义因通过定义的各种宏状态而改变#define 指令.换句话说,当您多次包含一个头文件并且在不同的宏状态下头的使用发生变化时,IntelliSense 并不总是有效.

IntelliSense is not fully supported when you reference a header file multiple times by using the #include directive, and the meaning of that header file changes because of various macro states that are defined through the #define directive. In other words, when you include a header file several times and the header usage changes under different macro states, IntelliSense does not always work.

参考:https://msdn.microsoft.com/en-us/library/ms235519.aspx