Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. error: C1083: Cannot open include file: 'QMainWindow': No such file or directory

error: C1083: Cannot open include file: 'QMainWindow': No such file or directory

Scheduled Pinned Locked Moved Solved General and Desktop
18 Posts 4 Posters 14.2k Views
  • 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.
  • jsulmJ jsulm

    @Panoss From the picture you posted I can see that Qt creator recognized MinGW.
    The second picture shows that you have issues with two of your Kits: Desctop and Unnamed.
    You should check them. Which of these Kits are you using?
    It is better to use MinGW which is provided with Qt: just use Qt Maintenance Tool to install Qt for MinGW and MinGW. I never had any issues with this combination.

    P Offline
    P Offline
    Panoss
    wrote on last edited by Panoss
    #9

    @jsulm said in error: C1083: Cannot open include file: 'QMainWindow': No such file or directory:

    just use Qt Maintenance Tool to install Qt...

    What is Qt Maintenance tool?

    jsulmJ 1 Reply Last reply
    0
    • P Panoss

      @jsulm said in error: C1083: Cannot open include file: 'QMainWindow': No such file or directory:

      just use Qt Maintenance Tool to install Qt...

      What is Qt Maintenance tool?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #10

      @Panoss If you used Qt Online Installer to install Qt then you have a tool in your Qt installation directory - Qt Maintenance Tool. You can use to update your installation, install other Qt versions and MinGW.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Panoss
        wrote on last edited by
        #11

        I didn't use the Online installer.
        I will uninstall my current Qt Creator and use the Online installer.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Panoss
          wrote on last edited by Panoss
          #12

          I 'm currently installing it with the online installer.
          It says it needs 6,32 (!!!)GB space for installation!
          Now I remembered why I had rejected Qt Designer and tried to use NetBeans.
          Anyway, I will install it for now, but later I will try the other way which is much more 'economical' when we 're talking about HDD space.

          jsulmJ 1 Reply Last reply
          0
          • P Offline
            P Offline
            Panoss
            wrote on last edited by
            #13

            It finished the installation and I tried to make a Qt Application to test it.
            But, no:
            The program has unexpectedly finished.

            I looked at kits:
            alt text

            1 Reply Last reply
            0
            • P Panoss

              I 'm currently installing it with the online installer.
              It says it needs 6,32 (!!!)GB space for installation!
              Now I remembered why I had rejected Qt Designer and tried to use NetBeans.
              Anyway, I will install it for now, but later I will try the other way which is much more 'economical' when we 're talking about HDD space.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by jsulm
              #14

              @Panoss 6,32GB?! What did you select to install? QtCreator is around 240MB, I don't think Netbeans is smaller. Qt 5.8 consumes 2,87GB on my machine.
              Which of the Kits did you use? All auto-detected Kits are for Visual Studio, not MinGW! It looks like you installed several Qt versions for Visual Studio, why? You wanted to use MinGW, right?
              Remove all Qt for Visual Studio and add Qt 5.8 for MinGW and make sure MinGW is selected under Qt/Tools in Qt Maintenance Tool.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              P 1 Reply Last reply
              1
              • jsulmJ jsulm

                @Panoss 6,32GB?! What did you select to install? QtCreator is around 240MB, I don't think Netbeans is smaller. Qt 5.8 consumes 2,87GB on my machine.
                Which of the Kits did you use? All auto-detected Kits are for Visual Studio, not MinGW! It looks like you installed several Qt versions for Visual Studio, why? You wanted to use MinGW, right?
                Remove all Qt for Visual Studio and add Qt 5.8 for MinGW and make sure MinGW is selected under Qt/Tools in Qt Maintenance Tool.

                P Offline
                P Offline
                Panoss
                wrote on last edited by Panoss
                #15

                @jsulm said in error: C1083: Cannot open include file: 'QMainWindow': No such file or directory:

                @Panoss 6,32GB?! What did you select to install? QtCreator is around 240MB, I don't think Netbeans is smaller. Qt 5.8 consumes 2,87GB on my machine.

                I left the default settings.
                Indeed, I saw multiple versions of Qt selected, but I thought 'it's the default, I'll leave it as is'

                Which of the Kits did you use? All auto-detected Kits are for Visual Studio, not MinGW! It looks like you installed several Qt versions for Visual Studio, why?

                No, I didn't want anything ike this. They automatically got installed. I 'll remove them.

                You wanted to use MinGW, right?

                Yeah. It's just that I 'm an absolute beginner and I've messed everything up!

                Remove all Qt for Visual Studio and add Qt 5.8 for MinGW

                I 'll do this.

                and make sure MinGW is selected under Qt/Tools in Qt Maintenance Tool.

                This is what I had selected in the beginning, but then I deselected MinGW under Qt/Tools and selected MinGW under Qt 5.8.
                And worked, while with the previous selection didn't.
                (I noticed that when I selected the MinGW under Qt 5.8, automatically a MinGW under Qt/Tools was also selected )

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  Panoss
                  wrote on last edited by Panoss
                  #16

                  jsulm I did as you said, I made a test Qt Applicaion, it run from the very first time!!
                  But, in the editor, it shows errors: words underlined with red color, others with yellow - light green color.
                  And red circles on the left.
                  But, despite these, the program compiles and runs!
                  Take a look at the picture to see what I mean:
                  alt text

                  EDIT: The errors disappeared! I didn't do anything!

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #17

                    Might be the code model that wasn't completely initialised yet.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    1
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #18

                      By the way, since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum members may know a solution has been found :)

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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