Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] CDT and the pre-processor

Hi All,


I am starting to look into an apparent problem with CDT's ability to follow header file include paths, header file conditionals, etc. And possibly its just my own ignorance, and I am making a mistake. Anyways, I wanted to ask the experts and make sure I am not headed in the wrong direction.


FWIW, I am using CDT 9.3 at the moment, but I am not sure the version matters here.


In my project properties, I add an include path to a directory containing the "main" header file for the sources in the project (note, in this discussion all of the include paths mentioned are external to the project). By doing so, it allows a source file in my project to successfully (ie. without error) include a header file in that directory. That said, the source file also uses pre-processor macros that are defined in a different header file.

The second header file is included by the first header file. In other words, the source file doesn't directly include the second header file, rather it only includes it indirectly because the first header file includes the second one. 

And for what it is worth, I have also added the include path to the second header file in my project properties, even though the source file doesn't directly include the second header.

The project compiles fine, but the Problems View shows errors presumably because the CDT parser isn't able to find the second header file. Possibly this happens because the CDT parser doesn't include a fully implemented pre-processor? On a related topic, I am also wondering what happens if some macros might be encapsulated by conditional pre-processor macros (which isn't the case with this particular macro, but I am wondering if this might be a problem)


Richard




Back to the top