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. error: 'QMainWindow' file not found #include <QMainWindow> ^
Forum Updated to NodeBB v4.3 + New Features

error: 'QMainWindow' file not found #include <QMainWindow> ^

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
3 Posts 3 Posters 6.9k 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.
  • A Offline
    A Offline
    AnnieChen
    wrote on last edited by AnnieChen
    #1

    Hi,

    I'm using Qt.5.70 version and macOS 10.12.

    I have an exist project that is created as C++ project. Then i find out that I need GUI, so I add New Qt Designer Form Class to create a GUI.

    But when I try to build, there is an error:

    /Users/zhijunchen/Dropbox/Wholesale-Clud/src/Wholesale-Club/mainwindow.h:8: error: 'QMainWindow' file not found
    #include <QMainWindow>
    ^

    I have these in my .pro file already:

    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    but still not working.

    Can anyone help me please?
    Thank you!
    Annie

    1 Reply Last reply
    0
    • m.sueM Offline
      m.sueM Offline
      m.sue
      wrote on last edited by
      #2

      Hi,
      maybe you just need to re-run qmake.
      -Michael.

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mostefa
        wrote on last edited by mostefa
        #3

        Hi @AnnieChen

        I think that you need to add also widgets module in your .pro file

        QT += widgets

        http://doc.qt.io/qt-5/qtwidgets-index.html

        If this not work for you , can tell us which qt version are you using?

        1 Reply Last reply
        1

        • Login

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