Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

qt creator : no such a file or directory

hi i'm just trying to compile an easy project in qt

#include <QApplication>

#include <QPushButton>

int main(int argc, char *argv[])
{
  QApplication app(argc, argv);

QPushButton bouton("Salut les Zéros, la forme ?");
bouton.show();

return app.exec();
}

but i have this error : /home/eid/test/easyprojet/main.cpp:1: error: QApplication: No such file or directory

can anyone help me ?

sorry for my english

like image 800
Philippe Eid Avatar asked Jan 22 '26 13:01

Philippe Eid


1 Answers

In Qt5, it resides in , while in Qt4 it was .

In Qt5 you need to add QT += widgets to your .pro file.

like image 82
Armand Avatar answered Jan 26 '26 05:01

Armand