How to get IntelliSense to reliably work in Visual Studio 2008

后端 未结 12 1606
暗喜
暗喜 2020-12-08 04:13

Does anyone know how to get IntelliSense to work reliably when working in C/C++ projects? It seems to work for about 1 in 10 files. Visual Studio 2005 seems to be a lot bett

12条回答
  •  孤街浪徒
    2020-12-08 05:01

    I had a very annoying problem, intellisense was working only in some files, without any evident reason... it took me a couple of hours of digging through google, but I finally understood that the reason was indeed recursive reference! I was using the:

    #ifndef CLASS_H
    #define CLASS_H
    ...
    #endif
    

    to avoid redefinition of symbols, and this sometimes breaks intellisense in big projects.

    But it is enough to comment the ifndef-define-endif and put a:

    #pragma once 
    

    at the beginning of the header files to still avoid redefinitions and have Intellisense working again =)=)

    At least, this worked for me, hope it's useful...

    Cheers Francesco

提交回复
热议问题