VC++2005 语法提示--Troubleshooting intellisense

在使用VC++2005自建C++项目的时候常常会遇到语法提示不能出来的问题。 在状态条会出现下面的提示:Troubleshooting IntelliSense in C++ Projects

    让我们来看看MSDN中的解释吧。
    为了实现C++项目中的语法提示需要做如下检查:
1.确认你的C++项目没有任何编译错误
2.确认一下INCLUDE环境变量,包含了stdafx.h文件所在位置
3.如果你的应用程序同时包含了托管C++代码和非托管C++代码,把这两部分代码分开到一个解决方案中的两个项目中去。
4.如果上面的方法都不见效,有可能在你的.ncb文件中出现了一些错误。需要重新生成该.ncb文件。关闭VS2005的IDE,删除.ncb文件。重新打开该工程并编译。 (我就用这个方法解决的)
    补充一点,有时候加入自定义的.h文件包含也是必要的尤其是使用宏来解释include文件的时候。比如在freetype2的编译中间接包含将不能出现语法提示,需要直接包含一些头文件。
   
===========================================================
下面是来自MSDN的原文: 
Troubleshooting IntelliSense in C++ Projects 

IntelliSense can stop working under certain conditions. Use the following procedure to help determine why IntelliSense does not work for your C++ projects.

To approach IntelliSense failure in C++ projects

  1. Make sure your Visual C++ project contains no compilation errors.

    1. If your project is a Makefile project, see How to: Enable IntelliSense for Makefile Projects.

  2. Make sure that stdafx.h is in the include path. For more information about include paths in Visual C++ projects, see #include and /I.

  3. If your solution contains a combination of the Managed Extensions for C++ and the new syntax for managed C++, then separate your solution into multiple solutions based on the syntax type.

  4. If none of the preceding steps help resolve IntelliSense failure, then there might be an error in the .ncb file for your solution.

    1. Copy the .ncb file and contact product support services. For more information about how to contact Microsoft for technical support, see Getting Help from Microsoft Product Support Services (Visual Studio).

    2. Regenerate the .ncb file for your solution.

To regenerate .ncb files

  1. Delete the .ncb file from your solution.

  2. Rebuild your solution.

The development environment automatically regenerates a new .ncb file for your solution.

IntelliSense LimitationsIntelliSense Limitations
  • The cursor is inside a code comment.

  • You are writing a string literal.

  • A syntax error appears above the cursor.

  • IntelliSense is not fully supported under the following circumstances:

  • When you reference a header file multiple times using the #include directive, and the meaning of that header file changes due to various macro states (which are defined through the #define directive). In other words, when you include a header file several times whose usage changes under different macro states, IntelliSense will not always work.

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值