QtCreator shows different "Multiple Parse Contexts" for C++ Header

Viewed 553

When I open a CMakeLists.txt in QtCreator and import an existing build, the editor offers multiple parse contexts for each header:

Active Parse Context Tooltip

Since the first parse context in the list is chosen, all headers are parsed as C headers which results in a broken IDE (namespaces are not recognized, includes do not work, etc):

Parse Contexts offered - C, C++, Obj-C and Obj-C++

Question: Is there a chance to define the whole project as C++ project? Or select the parse context globally for all headers? What is the reason for these "multiple parse contexts"?

1 Answers

I found an option to set the default "Active Parse Context" to C++: Turn off Interpret ambiguous headers as C headers.

Interpret ambiguous headers as C headers

In my case it helped a lot to disable also the "ClangCodeModel" since it failed to parse the files - while the built-in code model succeeds:

QtCreator - Installed Plugins - ClangCodeModel

Related