how to deal with "no such file error or diretory" error for a new programmer in QT creator

when i try to develop a hello demo in QT creator with the code following :app

#include<QApplication>
#include<QLabel>
int main(int argc,char *argv[])
{
    QApplication app(argc,argv);
    QLabel l("hello,word!");
    l.show();
    return app.exec();
}
post

the IDE inform me that "QApplication no such file or directory", then i search the Internet, and find that i should add the following code in "*.pro":ui

QT       += core gui widgetscode

or add the following:
orm

QT       += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgetsget

these code tell the qmake to include the header.

it

相關文章
相關標籤/搜索