Important: Please read the Qt Code of Conduct -

QT Other Projects/Empty Projects doesn't compile

  • I'm using QT 5.0 and VS Studio 2012 C++ I can compile GUI applications, but when I try to create other projects/Empty Projects and then add new main it won't compile.
    It says it can't find QApplication
    my code looks like this.

    #include <QApplication>
    #include <QLabel>

    int main(int argc, char *argv[])
    QApplication app (argc, argv);
    return app.exec();

  • Moderators

    You'll need to tell qmake that you want to use the Qt Widgets module. Add the line "QT += widgets" to your .pro file

  • That was easy it worked.

    Thank You very much

Log in to reply