Solved Weird editor errors caused by stddef.h
-
Qt Creator is not parsing the include files in my project properly and gives a lot of errors in the IDE, including errors like main.cpp:14:5: error: unknown type name 'QApplication'. However, my project compiles perfectly fine. I am getting tired of all these supposed errors and am wondering if there is any way to fix this issue.
I had a hunch from a few days ago (I forget exactly how I got this hunch) that
stddef.h
was causing the problem. So I added#include <stddef.h>
to mymain.cpp
, and Qt Creator gave the error:/home/loren/code/klock/main.cpp:12: error: 'stddef.h' file not found /usr/include/c++/9/ostream:42: to match this '{'
where the '{' is the beginning { in namespace std.
My .pro file looks like this:
QT += core gui widgets # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ klocktimer.cpp \ main.cpp \ klockmainwindow.cpp \ chronometer.cpp TRANSLATIONS += \ klock_en_US.ts \ klock_es_MX.ts # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target HEADERS += \ klocktimer.h \ klockmainwindow.h \ chronometer.h
-
@LorenDB Try to disable "ClangCodeModel" plug-in in "Help/About Plugins..."
-
@LorenDB Try to disable "ClangCodeModel" plug-in in "Help/About Plugins..."
-
Thanks, that fixed it.