Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. 'Unknown module(s)' error building Qt project (with subprojects) in Yocto

'Unknown module(s)' error building Qt project (with subprojects) in Yocto

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 2 Posters 561 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.
  • D Offline
    D Offline
    Dane 0
    wrote on last edited by
    #1

    I am trying to write a Yocto recipe for qthttpserver (https://github.com/qt-labs/qthttpserver, 5.15 branch). Here's what I have so far ('qthttpserver_5.15.bb'):

    SUMMARY = "qthttpserver recipe"
    
    DEPENDS = "qtbase qtwebsockets"
    
    LICENSE = "GPL-3.0-only"
    LIC_FILES_CHKSUM = "file://LICENSE.GPL3;md5=d32239bcb673463ab874e80d47fae504"
    
    SRC_URI = "gitsm://github.com/qt-labs/qthttpserver.git;protocol=https;branch=5.15"
    SRCREV = "52bce52413763ead7759f8c2e374a40bb82f058f"
    
    S = "${WORKDIR}/git"
    
    inherit qmake5
    
    do_install() {
        install -d ${libdir}
        cp ${S}/lib/* ${libdir}/
    }
    
    FILES:${PN} += " \
        ${libdir}/* \
    "
    

    This fails with Project ERROR: Unknown module(s) in QT: sslserver (presumably because the sslserver subproject is not getting built first?).

    If I try to manually run the build from a terminal (in the 'build' directory) with

    ../recipe-sysroot-native/usr/bin/qmake ../git/qthttpserver.pro -spec linux-g++
    ../recipe-sysroot-native/usr/bin/make -f Makefile qmake_all
    

    then I get Project ERROR: Unknown module(s) in QT: gui. The 'gui' module is not referenced in the project anywhere that I can find.

    If I try to manually run the build (from a terminal, in the 'build' directory) with the 'system' qmake

    "/opt/Qt/5.15.2/gcc_64/bin/qmake" ../git/qthttpserver.pro -spec linux-g++
    ../recipe-sysroot-native/usr/bin/make -f Makefile qmake_all
    

    then it builds fine.

    What is going on here?

    jsulmJ 1 Reply Last reply
    0
    • D Dane 0

      Looking a bit more closely, it seems like sslserver is optional; src.pro contains the following:

      qtConfig(ssl) {
          SUBDIRS += sslserver
          httpserver.depends = sslserver
      }
      

      and there are similar conditionals in the httpserver project:

      #if QT_CONFIG(ssl)
      #include <QtSslServer/qsslserver.h>
      #include <QSslCertificate>
      #include <QSslKey>
      #endif
      
      D Offline
      D Offline
      Dane 0
      wrote on last edited by
      #5

      Solved by adding require ../../../meta-qt5/recipes-qt/qt5/qt5.inc to the recipe (and removing inherit qmake5, as it's included in qt5.inc in any case).

      Made some progress by setting OE_QMAKE_RECURSIVE = "" but then was struggling with the installation part, and eventually realised that just requiring qt5.inc solved everything.

      1 Reply Last reply
      0
      • D Dane 0

        I am trying to write a Yocto recipe for qthttpserver (https://github.com/qt-labs/qthttpserver, 5.15 branch). Here's what I have so far ('qthttpserver_5.15.bb'):

        SUMMARY = "qthttpserver recipe"
        
        DEPENDS = "qtbase qtwebsockets"
        
        LICENSE = "GPL-3.0-only"
        LIC_FILES_CHKSUM = "file://LICENSE.GPL3;md5=d32239bcb673463ab874e80d47fae504"
        
        SRC_URI = "gitsm://github.com/qt-labs/qthttpserver.git;protocol=https;branch=5.15"
        SRCREV = "52bce52413763ead7759f8c2e374a40bb82f058f"
        
        S = "${WORKDIR}/git"
        
        inherit qmake5
        
        do_install() {
            install -d ${libdir}
            cp ${S}/lib/* ${libdir}/
        }
        
        FILES:${PN} += " \
            ${libdir}/* \
        "
        

        This fails with Project ERROR: Unknown module(s) in QT: sslserver (presumably because the sslserver subproject is not getting built first?).

        If I try to manually run the build from a terminal (in the 'build' directory) with

        ../recipe-sysroot-native/usr/bin/qmake ../git/qthttpserver.pro -spec linux-g++
        ../recipe-sysroot-native/usr/bin/make -f Makefile qmake_all
        

        then I get Project ERROR: Unknown module(s) in QT: gui. The 'gui' module is not referenced in the project anywhere that I can find.

        If I try to manually run the build (from a terminal, in the 'build' directory) with the 'system' qmake

        "/opt/Qt/5.15.2/gcc_64/bin/qmake" ../git/qthttpserver.pro -spec linux-g++
        ../recipe-sysroot-native/usr/bin/make -f Makefile qmake_all
        

        then it builds fine.

        What is going on here?

        jsulmJ Online
        jsulmJ Online
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @Dane-0 Shouldn't you add sslserver to DEPENDS?

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

        D 1 Reply Last reply
        0
        • jsulmJ jsulm

          @Dane-0 Shouldn't you add sslserver to DEPENDS?

          D Offline
          D Offline
          Dane 0
          wrote on last edited by
          #3

          @jsulm sslserver is one of the subprojects. Adding it to DEPENDS just errors out, presumably because it hasn't been built yet at the time the recipe is run. It seems that perhaps if sslserver was built before httpserver then that might solve the problem (as httpserver does depend on sslserver), but I have no idea how any of that is decided behind the scenes and why it works under some scenarios (e.g. when built from QtCreator, or using specific terminal commands as mentioned).

          The project structure is:

          ├── qthttpserver.pro
          ├── examples
          │   ├── examples.pro
          │   └── httpserver
          │       ├── httpserver.pro
          │       └── simple
          │           └── simple.pro
          ├── src
          │   ├── src.pro
          │   ├── 3rdparty
          │   │   ├── http-parser
          │   │   │   └── Makefile
          │   │   └── http-parser.pri
          │   ├── httpserver
          │   │   └── httpserver.pro
          │   └── sslserver
          │       └── sslserver.pro
          └── tests
              ├── auto
              │   ├── auto.pro
              │   ├── cmake
              │   │   ├── CMakeLists.txt
              │   │   ├── abstracthttpserver
              │   │   │   └── CMakeLists.txt
              │   │   └── cmake.pro
              │   ├── qabstracthttpserver
              │   │   └── qabstracthttpserver.pro
              │   ├── qhttpserver
              │   │   └── qhttpserver.pro
              │   ├── qhttpserverresponder
              │   │   └── qhttpserverresponder.pro
              │   ├── qhttpserverresponse
              │   │   └── qhttpserverresponse.pro
              │   └── qhttpserverrouter
              │       └── qhttpserverrouter.pro
              └── tests.pro
          
          D 1 Reply Last reply
          0
          • D Dane 0

            @jsulm sslserver is one of the subprojects. Adding it to DEPENDS just errors out, presumably because it hasn't been built yet at the time the recipe is run. It seems that perhaps if sslserver was built before httpserver then that might solve the problem (as httpserver does depend on sslserver), but I have no idea how any of that is decided behind the scenes and why it works under some scenarios (e.g. when built from QtCreator, or using specific terminal commands as mentioned).

            The project structure is:

            ├── qthttpserver.pro
            ├── examples
            │   ├── examples.pro
            │   └── httpserver
            │       ├── httpserver.pro
            │       └── simple
            │           └── simple.pro
            ├── src
            │   ├── src.pro
            │   ├── 3rdparty
            │   │   ├── http-parser
            │   │   │   └── Makefile
            │   │   └── http-parser.pri
            │   ├── httpserver
            │   │   └── httpserver.pro
            │   └── sslserver
            │       └── sslserver.pro
            └── tests
                ├── auto
                │   ├── auto.pro
                │   ├── cmake
                │   │   ├── CMakeLists.txt
                │   │   ├── abstracthttpserver
                │   │   │   └── CMakeLists.txt
                │   │   └── cmake.pro
                │   ├── qabstracthttpserver
                │   │   └── qabstracthttpserver.pro
                │   ├── qhttpserver
                │   │   └── qhttpserver.pro
                │   ├── qhttpserverresponder
                │   │   └── qhttpserverresponder.pro
                │   ├── qhttpserverresponse
                │   │   └── qhttpserverresponse.pro
                │   └── qhttpserverrouter
                │       └── qhttpserverrouter.pro
                └── tests.pro
            
            D Offline
            D Offline
            Dane 0
            wrote on last edited by
            #4

            Looking a bit more closely, it seems like sslserver is optional; src.pro contains the following:

            qtConfig(ssl) {
                SUBDIRS += sslserver
                httpserver.depends = sslserver
            }
            

            and there are similar conditionals in the httpserver project:

            #if QT_CONFIG(ssl)
            #include <QtSslServer/qsslserver.h>
            #include <QSslCertificate>
            #include <QSslKey>
            #endif
            
            D 1 Reply Last reply
            0
            • D Dane 0

              Looking a bit more closely, it seems like sslserver is optional; src.pro contains the following:

              qtConfig(ssl) {
                  SUBDIRS += sslserver
                  httpserver.depends = sslserver
              }
              

              and there are similar conditionals in the httpserver project:

              #if QT_CONFIG(ssl)
              #include <QtSslServer/qsslserver.h>
              #include <QSslCertificate>
              #include <QSslKey>
              #endif
              
              D Offline
              D Offline
              Dane 0
              wrote on last edited by
              #5

              Solved by adding require ../../../meta-qt5/recipes-qt/qt5/qt5.inc to the recipe (and removing inherit qmake5, as it's included in qt5.inc in any case).

              Made some progress by setting OE_QMAKE_RECURSIVE = "" but then was struggling with the installation part, and eventually realised that just requiring qt5.inc solved everything.

              1 Reply Last reply
              0
              • D Dane 0 has marked this topic as solved on

              • Login

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