Search code examples
c++qtqt-creator

Qt Creator shows errors in fresh project, but code compiles fine


Context: I recently switched from debian stable to debian testing so I have updated several hundred packages since the last time I used QT creator.

When I create a new project in QT creator I am greeted with many error messages.

For example, here are the errors for the autogenerated main.cpp class in a fresh project:

cstddef:50:10: fatal error: 'stddef.h' file not found
error: variable has incomplete type 'QApplication'
forward declaration of 'QApplication'
unknown type name 'MainWindow'

When I open up previous projects that I know have no errors they also show a whole bunch of similar errors.

However, all of these projects build and run just fine.

What is causing this?


Solution

  • I found the solution to this problem in this bug report.

    The libclang-common-8-dev package needs to be installed. After installing this package and restarting qt creator all of the errors went away.