I have just installed QTCreator in Linux Ubuntu 20.04 LTS, I clicked on File->New Project->Application->QTConsole Application. A first.pro file and main.cpp file was made.
The first.pro contains:
QT -= gui declarative
QT += widgets
CONFIG += c++11 console
CONFIG -= app_bundle
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
main.cpp
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
The main.cpp contains:
#include <QCoreApplication>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
return a.exec();
}
The error comes in QCoreApplication line.
If the error is an open red circle, the code will still build.
If you want to get rid of the open red circles, go into Help->About Plugins and uncheck the Clang code model plugin. Then restart QT creator.