user2035257
user2035257

Reputation:

Error in Qt program

This code

#include <QtWidgets/QApplication>
#include <QLabel>

int main(int argc,char *argv[])
{
    QApplication app(argc,argv);
    QLabel *label = new QLabel("my first app");
    label->show();
    return app.exec();
}

Causing an error:

QLabel: there is no such directory

I am using Qt 5.0.1 in Windows

Upvotes: 1

Views: 87

Answers (2)

guest
guest

Reputation: 1

Put QT += widgets in your .pro file.

Upvotes: 0

4pie0
4pie0

Reputation: 29724

change

#include <QLabel>

to #include <QtWidgets/QLabel> This is where QLabel actually resides (if this is that QLabel that you want)

Upvotes: 2

Related Questions