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. QtWidgets: No such file or directory
Qt 6.11 is out! See what's new in the release blog

QtWidgets: No such file or directory

Scheduled Pinned Locked Moved General and Desktop
14 Posts 2 Posters 5.5k 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.
  • F Offline
    F Offline
    Finaren
    wrote on last edited by
    #1

    Hi,

    I was using Qt 4.8, but failed to compile the affine example. Then I found the only solution seems to be using Qt 5.

    I downloaded Qt 5.1.0 for Windows 64-bit (VS 2012, 525 MB). I don't have VS2012, instead I have VS2010. But I have to download this, because my computer is 64 bit windows. So I configured the compiler under the "Tools". The VS2010 is automatically detected, and I rename it as MSVS10.

    Now I cannot see the "MSVS10" under "kit" behind the green arrow button.

    And when I run it with kit "Desktop", it says the QtWidgets: No such file or directory.

    Anyone could help?

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

      Hi and welcome to devnet,

      Then use the VS2010 build (don't mix newer and older mscv version that's asking for trouble). There is absolutely no problem using a 32bit program in Windows 64bit (or building it)

      For Qt 5 widgets have been moved to their own module. Add

      @QT += widgets@

      To your pro file

      Hope it helps

      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
      • F Offline
        F Offline
        Finaren
        wrote on last edited by
        #3

        Hi SGaist, I have checked the pro file, that statement is there.

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

          First thing, clean your Qt install and get the VS2010 build, then delete your project build directory and rebuild your project

          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
          • F Offline
            F Offline
            Finaren
            wrote on last edited by
            #5

            Hi SGaist, thank you for the prompt help. I guess you mean to clean the project, and then build it? So I right click on the project, pressing "clean" and then pressing "build", still the same "QtWidgets: no such file or directory". And I also noticed that although I choose the VS2010 in "Tools options", but the compiler that I named does not show behind the "kit", i.e., the green arrow button. And I also changed Qt4.8 ev. QTDIR value to the new Qt5.1.0 directory.

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

              Like I said, you are mixing 2012 and 2010 => just asking for trouble. The compilers are not same. Remove your 2012 Qt and get the 2010, then make a kit with it.
              Don't play to much around, you are just going to end with a system unusable for development.

              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
              • F Offline
                F Offline
                Finaren
                wrote on last edited by
                #7

                Hi SGaist, thank you the problem is solved.

                But I have some unclear questions:

                there is an official guide to show how to choose the compiler in the IDE, why it failed with affine example by saying QtWidgets is missing, I guess probably I didn't choose the compiler in a correct way?

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

                  The first thing is to get the Qt version that matches your compiler. If you don't have any, start with mingw otherwise, install Visual Studio then Qt. That will automate most thing for you (like the compiler selection)

                  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
                  • F Offline
                    F Offline
                    Finaren
                    wrote on last edited by
                    #9

                    Hi SGaist, based on the results that is the solution, at least to compile the examples. Thanks.

                    Why the 64 bits and 32 bits Qt5.1.0 both work on my 64 bit Windows? if both work undistinguishedlly, why there are both available to download?

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

                      Because Windows 64 bit allows to also run 32bit application. They work but not undistinguished.

                      Because not all Windows system around the world are 64bit, some legacy library are not 64bit, some legacy system can't be updated to 64bit

                      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
                      • F Offline
                        F Offline
                        Finaren
                        wrote on last edited by
                        #11

                        Hi SGaist, then what are the purpose for the 64 bit Qt 5.1.0 ? under which occasion should I use the 64 bit one and under which occasion should I use the 32 bit one?

                        so many questions about it 'cause I m really interested in Qt :))

                        Thank you.

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

                          To relieve you from the duty of building Qt yourself, which can be complex for the 5 series.

                          64bit as much as possible, 32bit when building for system running a 32bit version of windows. Beware that there are some differences between 32bit and 64bit development, one being the RAM size accessible from the application.

                          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
                          • F Offline
                            F Offline
                            Finaren
                            wrote on last edited by
                            #13

                            Hi SGaist, all clear so far, thank you! :))

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

                              You're welcome ! Happy coding :)

                              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