we recently ran into a problem that QtCreator fails to interpret hpp header files.
Error messages like
"Expected a function declaration" on namespace A {
or "Expected ';' got 'class' on class B {
are shown and the syntax highlighting doesn't work correcltly.
We found out that this issue is related to the following compiler flags:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
By deleting the first line (CMAKE_C_FLAGS std=gnu99), QtCreator interprets the herader files correctly.
Somehow QtCreator seems to use CMAKE_C_FLAGS for parsing c++ header files.
Is this maybe a issue with QtCreator? Do we miss something?