Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QT Other Projects/Empty Projects doesn't compile
Forum Updated to NodeBB v4.3 + New Features

QT Other Projects/Empty Projects doesn't compile

Scheduled Pinned Locked Moved Installation and Deployment
3 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pronesti
    wrote on last edited by
    #1

    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();
    }

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

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

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pronesti
        wrote on last edited by
        #3

        That was easy it worked.

        Thank You very much

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved