This project item is not a candidate for analysisIf you encounter the following error in Visual Studio: This project item is not a candidate for analysis because: This project item does not have an assigned compiler. No suitable project item found for indirect analysis. This is due to the concept of conditional compilation; it is very common for Visual Studio configurations (project's toolset, target platform, and release) to dictate which preprocessor definitions are defined. Example ![]() In the above example, a preprocessor define "DEBUG" is used to control the implementation of printStr method. In this case, DEBUG is not defined and thus Visual Studio grays out unused code. When these Visual Studio configurations are combined with conditional header files inclusions, Klocwork produces a message which states that a header file cannot be analyzed. Here is a screen shot of this scenario: ![]() As you can see, the UTF8 preprocessor definition is not set, and thus Utf8.h is not included. If Utf8.h is not included by any other compilable file, Visual Studio and Klocwork cannot compile this file. To verify a file is a candidate for analysis, right click on the file in the Solution Explorer and verify that the Compile option is available. |