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. Problem building Qt for Raspberry Pi OS
QtWS25 Last Chance

Problem building Qt for Raspberry Pi OS

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 6 Posters 1.0k 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.
  • S Offline
    S Offline
    superg
    wrote on 12 Apr 2023, 05:57 last edited by superg 4 Dec 2023, 06:02
    #1

    Hello, I'm following this guide:
    https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi
    To cross-compile Qt 6 for a Raspberry PI 3B+ with a Raspberry Pi OS 32 bits.
    When trying to execute the command (You can find it in the guide under Building Qt 6 for Target Device):

    cmake ../qt5/ -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_FEATURE_opengles2=ON -DINPUT_opengl=es2 -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DQT_HOST_PATH=$HOME/qt-host -DCMAKE_STAGING_PREFIX=$HOME/qt-raspi -DCMAKE_INSTALL_PREFIX=/usr/local/qt6 -DCMAKE_TOOLCHAIN_FILE=$HOME/toolchain.cmake -DQT_QMAKE_TARGET_MKSPEC=devices/linux-rasp-pi4-aarch64 -DQT_FEATURE_xcb=ON -DQT_FEATURE_xcb_xlib=ON -DQT_FEATURE_xlib=ON
    

    I get the following error:

    CMake Error at qtbase/cmake/QtToolHelpers.cmake:184 (message):
      Failed to find the host tool "Qt6::qdoc".  It is part of the Qt6ToolsTools                                       
      package, but the package did not contain the tool.  Make sure that the host                                      
      module Tools was built with all features enabled (no explicitly disabled                                         
      tools).                                                                                                          
    Call Stack (most recent call first):                                                                               
      qttools/src/qdoc/CMakeLists.txt:20 (qt_internal_add_tool) 
    

    I made a modification to the command. I added the -DQT_FEATURE_opengles2=ON flag because I was getting the same error detailed here, but that did the trick.

    I have a few questions:

    • Is it okay to use this guide for a Raspberry Pi 3 B+? I haven't found a guide for installing Qt 6 on this particular model, and I have no experience in this kind of work, it's the first time I try to cross compile for a Raspberry Pi.
    • Is it ok to use a 32 bit version of Raspberry Pi OS or should I use a 64 bit one?
    • Is the command ok? Knowing that it's for a Raspberry Pi 3, I'm having my doubts about the -DQT_QMAKE_TARGET_MKSPEC=devices/linux-rasp-pi4-aarch64 part of the command.
    • How can I solve the error mentioned above? Could it be related to the deactivation of webengine that I made? I used the command:
    cmake ../qt5/ -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DQT_FEATURE_webengine=OFF -DCMAKE_INSTALL_PREFIX=$HOME/qt-host
    

    when building Qt6, at the Building Qt 6 for Host Machine section. Maybe it had an impact on the Qt6ToolsTools package?

    Thank you all in advance.

    O T 2 Replies Last reply 15 Apr 2023, 13:25
    0
    • S superg
      12 Apr 2023, 05:57

      Hello, I'm following this guide:
      https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi
      To cross-compile Qt 6 for a Raspberry PI 3B+ with a Raspberry Pi OS 32 bits.
      When trying to execute the command (You can find it in the guide under Building Qt 6 for Target Device):

      cmake ../qt5/ -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_FEATURE_opengles2=ON -DINPUT_opengl=es2 -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DQT_HOST_PATH=$HOME/qt-host -DCMAKE_STAGING_PREFIX=$HOME/qt-raspi -DCMAKE_INSTALL_PREFIX=/usr/local/qt6 -DCMAKE_TOOLCHAIN_FILE=$HOME/toolchain.cmake -DQT_QMAKE_TARGET_MKSPEC=devices/linux-rasp-pi4-aarch64 -DQT_FEATURE_xcb=ON -DQT_FEATURE_xcb_xlib=ON -DQT_FEATURE_xlib=ON
      

      I get the following error:

      CMake Error at qtbase/cmake/QtToolHelpers.cmake:184 (message):
        Failed to find the host tool "Qt6::qdoc".  It is part of the Qt6ToolsTools                                       
        package, but the package did not contain the tool.  Make sure that the host                                      
        module Tools was built with all features enabled (no explicitly disabled                                         
        tools).                                                                                                          
      Call Stack (most recent call first):                                                                               
        qttools/src/qdoc/CMakeLists.txt:20 (qt_internal_add_tool) 
      

      I made a modification to the command. I added the -DQT_FEATURE_opengles2=ON flag because I was getting the same error detailed here, but that did the trick.

      I have a few questions:

      • Is it okay to use this guide for a Raspberry Pi 3 B+? I haven't found a guide for installing Qt 6 on this particular model, and I have no experience in this kind of work, it's the first time I try to cross compile for a Raspberry Pi.
      • Is it ok to use a 32 bit version of Raspberry Pi OS or should I use a 64 bit one?
      • Is the command ok? Knowing that it's for a Raspberry Pi 3, I'm having my doubts about the -DQT_QMAKE_TARGET_MKSPEC=devices/linux-rasp-pi4-aarch64 part of the command.
      • How can I solve the error mentioned above? Could it be related to the deactivation of webengine that I made? I used the command:
      cmake ../qt5/ -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DQT_FEATURE_webengine=OFF -DCMAKE_INSTALL_PREFIX=$HOME/qt-host
      

      when building Qt6, at the Building Qt 6 for Host Machine section. Maybe it had an impact on the Qt6ToolsTools package?

      Thank you all in advance.

      O Offline
      O Offline
      oniongarlic
      wrote on 15 Apr 2023, 13:25 last edited by
      #2

      @superg I'd recommend doing a native build, start with qtbase and then add whatever else you need. It does take a while but is way easier than cross-compiling.

      Qt 6.5.0 builds cleanly without any issues on latest 64-bit Raspberry Pi OS.

      You can use my guide for 6.2 LTS (it is slightly outdated to be Buster compatible, but main points are the same) https://www.tal.org/tutorials/building-qt-62-raspberry-pi-raspberry-pi-os

      N 1 Reply Last reply 6 Dec 2023, 21:53
      0
      • S superg
        12 Apr 2023, 05:57

        Hello, I'm following this guide:
        https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi
        To cross-compile Qt 6 for a Raspberry PI 3B+ with a Raspberry Pi OS 32 bits.
        When trying to execute the command (You can find it in the guide under Building Qt 6 for Target Device):

        cmake ../qt5/ -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_FEATURE_opengles2=ON -DINPUT_opengl=es2 -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DQT_HOST_PATH=$HOME/qt-host -DCMAKE_STAGING_PREFIX=$HOME/qt-raspi -DCMAKE_INSTALL_PREFIX=/usr/local/qt6 -DCMAKE_TOOLCHAIN_FILE=$HOME/toolchain.cmake -DQT_QMAKE_TARGET_MKSPEC=devices/linux-rasp-pi4-aarch64 -DQT_FEATURE_xcb=ON -DQT_FEATURE_xcb_xlib=ON -DQT_FEATURE_xlib=ON
        

        I get the following error:

        CMake Error at qtbase/cmake/QtToolHelpers.cmake:184 (message):
          Failed to find the host tool "Qt6::qdoc".  It is part of the Qt6ToolsTools                                       
          package, but the package did not contain the tool.  Make sure that the host                                      
          module Tools was built with all features enabled (no explicitly disabled                                         
          tools).                                                                                                          
        Call Stack (most recent call first):                                                                               
          qttools/src/qdoc/CMakeLists.txt:20 (qt_internal_add_tool) 
        

        I made a modification to the command. I added the -DQT_FEATURE_opengles2=ON flag because I was getting the same error detailed here, but that did the trick.

        I have a few questions:

        • Is it okay to use this guide for a Raspberry Pi 3 B+? I haven't found a guide for installing Qt 6 on this particular model, and I have no experience in this kind of work, it's the first time I try to cross compile for a Raspberry Pi.
        • Is it ok to use a 32 bit version of Raspberry Pi OS or should I use a 64 bit one?
        • Is the command ok? Knowing that it's for a Raspberry Pi 3, I'm having my doubts about the -DQT_QMAKE_TARGET_MKSPEC=devices/linux-rasp-pi4-aarch64 part of the command.
        • How can I solve the error mentioned above? Could it be related to the deactivation of webengine that I made? I used the command:
        cmake ../qt5/ -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DQT_FEATURE_webengine=OFF -DCMAKE_INSTALL_PREFIX=$HOME/qt-host
        

        when building Qt6, at the Building Qt 6 for Host Machine section. Maybe it had an impact on the Qt6ToolsTools package?

        Thank you all in advance.

        T Offline
        T Offline
        TracerBullet
        wrote on 12 May 2023, 20:28 last edited by
        #3

        @superg Did you get this resolved? I'm having the same error.

        CMake Error at qtbase/cmake/QtToolHelpers.cmake:184 (message):
          Failed to find the host tool "Qt6::qdoc".  It is part of the Qt6ToolsTools
          package, but the package did not contain the tool.  Make sure that the host
          module Tools was built with all features enabled (no explicitly disabled
          tools).
        Call Stack (most recent call first):
          qttools/src/qdoc/CMakeLists.txt:20 (qt_internal_add_tool)
        
        
        -- Configuring incomplete, errors occurred!
        
        

        I'm trying to develop a GUI, and with the size of the touchscreen I'm using, a native build is really out of the question.

        1 Reply Last reply
        0
        • O oniongarlic
          15 Apr 2023, 13:25

          @superg I'd recommend doing a native build, start with qtbase and then add whatever else you need. It does take a while but is way easier than cross-compiling.

          Qt 6.5.0 builds cleanly without any issues on latest 64-bit Raspberry Pi OS.

          You can use my guide for 6.2 LTS (it is slightly outdated to be Buster compatible, but main points are the same) https://www.tal.org/tutorials/building-qt-62-raspberry-pi-raspberry-pi-os

          N Offline
          N Offline
          nero_ner
          wrote on 6 Dec 2023, 21:53 last edited by
          #4

          @oniongarlic Sometimes you cannot build natively. A raspberry pi model 4b with 1 gb of ram cannot compile qt, it cannot even build cmake from source without running out of memory.

          O 1 Reply Last reply 3 Jan 2024, 11:44
          0
          • N nero_ner
            6 Dec 2023, 21:53

            @oniongarlic Sometimes you cannot build natively. A raspberry pi model 4b with 1 gb of ram cannot compile qt, it cannot even build cmake from source without running out of memory.

            O Offline
            O Offline
            oniongarlic
            wrote on 3 Jan 2024, 11:44 last edited by
            #5

            @nero_ner 4GB and 8GB models are available, just build on one of those and copy over.

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jlouts
              wrote on 4 Feb 2024, 14:57 last edited by
              #6

              I ran into a similar problem with QDoc not getting built. The issue was that, at least on ubuntu, libclang-dev doesn't provide the necessary cmake files. Install clang provided the cmake files needed for QDoc to be built.

              Also worth noting that you might need to remove your build directory to make sure cmake isn't caching anything when you reconfigure your build.

              Ronel_qtmasterR 1 Reply Last reply 5 Feb 2024, 13:29
              0
              • J jlouts
                4 Feb 2024, 14:57

                I ran into a similar problem with QDoc not getting built. The issue was that, at least on ubuntu, libclang-dev doesn't provide the necessary cmake files. Install clang provided the cmake files needed for QDoc to be built.

                Also worth noting that you might need to remove your build directory to make sure cmake isn't caching anything when you reconfigure your build.

                Ronel_qtmasterR Offline
                Ronel_qtmasterR Offline
                Ronel_qtmaster
                wrote on 5 Feb 2024, 13:29 last edited by
                #7

                @jlouts check this.It is not on Ubuntu but it can hugely help you

                https://drive.google.com/file/d/1-Dd228_crhvV1VJnNjqLCAl3O6_cWeJ4/view?usp=drive_link

                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