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. Failing to load modules 5.4.1[SOLVED]
Forum Update on Monday, May 27th 2025

Failing to load modules 5.4.1[SOLVED]

Scheduled Pinned Locked Moved General and Desktop
12 Posts 3 Posters 2.8k 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.
  • N Offline
    N Offline
    Narcoleptic
    wrote on last edited by Narcoleptic
    #1

    I'm trying to do my first project in Qt and finding it very simple and intuitive so far, but when I try to build my project I get the following error:
    :-1: error: Unknown module(s) in QT: core gui declarative quick

    I've searched google but haven't gotten any definitive answers there. I've tried doing a fresh install with no luck. Primarily I run Windows 8.1, but I've tried in Kubuntu as well with the same error. I'm including a .pri file which declares all the modules like so:

    QT       += core gui
    
    greaterThan(QT_VERSION, 4.7): QT += declarative
    greaterThan(QT_VERSION, 5.0): QT += quick
    

    Is there something missing in my installs or is there some setting that need to be changed?

    K 1 Reply Last reply
    0
    • N Narcoleptic

      I'm trying to do my first project in Qt and finding it very simple and intuitive so far, but when I try to build my project I get the following error:
      :-1: error: Unknown module(s) in QT: core gui declarative quick

      I've searched google but haven't gotten any definitive answers there. I've tried doing a fresh install with no luck. Primarily I run Windows 8.1, but I've tried in Kubuntu as well with the same error. I'm including a .pri file which declares all the modules like so:

      QT       += core gui
      
      greaterThan(QT_VERSION, 4.7): QT += declarative
      greaterThan(QT_VERSION, 5.0): QT += quick
      

      Is there something missing in my installs or is there some setting that need to be changed?

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @Narcoleptic
      Hi and welcome to devnet

      This sounds strange to me. However, typically those statements you will find in the main .pro file and not in an included .pri file.
      Try to place those statements in your .pro file.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • N Offline
        N Offline
        Narcoleptic
        wrote on last edited by
        #3

        I commented out those lines in the .pri and added this in the .pro

        QT      += core gui quick declarative
        

        With the same result, tried putting them on separate lines as well with QT += for each individual line. Still no difference.

        K 1 Reply Last reply
        0
        • N Narcoleptic

          I commented out those lines in the .pri and added this in the .pro

          QT      += core gui quick declarative
          

          With the same result, tried putting them on separate lines as well with QT += for each individual line. Still no difference.

          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          @Narcoleptic
          Are you using Qt creator and run the qmake from there?

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • N Offline
            N Offline
            Narcoleptic
            wrote on last edited by
            #5

            Yes, I use Qt Creator and go to Build->Build All

            K 1 Reply Last reply
            0
            • N Narcoleptic

              Yes, I use Qt Creator and go to Build->Build All

              K Offline
              K Offline
              koahnig
              wrote on last edited by koahnig
              #6

              @Narcoleptic
              Do you have only one project?
              Goto to the "project" pane on left and select (one of) the project and do a right mouse click. From there you can "run qmake" and do similarly a "Rebuild all" after wards.
              If you really have different projects you can do this for every single project. With this procedure, you will also find if you are looking at the right place for a problem.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              0
              • N Offline
                N Offline
                Narcoleptic
                wrote on last edited by
                #7

                It is only one project. I have one .pro file and one main.cpp. Then in the .pro I use include (otherProject.pri), and in the main I include a header from the other project. That's all the project interactions I have.

                Running qmake gives the same error message.

                1 Reply Last reply
                0
                • N Offline
                  N Offline
                  Narcoleptic
                  wrote on last edited by
                  #8

                  To add to this, I tried one of the examples in Qt Creator, they seem to produce the same error.

                  1 Reply Last reply
                  0
                  • sneubertS Offline
                    sneubertS Offline
                    sneubert
                    wrote on last edited by
                    #9

                    Did you install the prebuild binaries of Qt for the compiler you are using, or did you compile Qt yourself?

                    1 Reply Last reply
                    0
                    • N Offline
                      N Offline
                      Narcoleptic
                      wrote on last edited by Narcoleptic
                      #10

                      For Windows I downloaded the .exe and ran the setup normally with default settings except that I put the install directory in "C:\Program Files (x86)\Qt" instead of "C:\Qt" which was proposed. In Kubuntu I don't remember if I used Muon Software Center or apt-get.

                      1 Reply Last reply
                      0
                      • sneubertS Offline
                        sneubertS Offline
                        sneubert
                        wrote on last edited by
                        #11

                        There has been a bug in qmake, that caused the error you described if there are whitespaces in you qmake path. If your kits are showing a correct installed qt version for your compiler my only suggestion is to try to install qt in a folder not containing whitespaces.

                        1 Reply Last reply
                        0
                        • N Offline
                          N Offline
                          Narcoleptic
                          wrote on last edited by
                          #12

                          That did the trick. Thank you.

                          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