i have a simple program. my program is:
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
int rc ;
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
rc = app.exec();
return(rc) ;
}
i want to compile and build this code in command line. i have installed qt and mingw.
first my command is:
qmake -project
then i give this command.
qmake
then qmake creates .pro file which is:
TEMPLATE = app
TARGET = HELLO
INCLUDEPATH += .
# Input
SOURCES += hello.cpp
i think this file must inclue ' QT += widgets' but it doesnt. i dont know why. finally, i call mingw make
and it gives error.
when i add .pro file QT += widgets then call mingw-make, it works and creates .exe file.
then my question is that, why qmake automatically add QT += widgets
, how can i do this? i dont want to add manually.