Problem building Qt for Raspberry Pi OS
-
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.
-
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.
@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
-
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.
@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.
-
@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
@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.
-
@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.
@nero_ner 4GB and 8GB models are available, just build on one of those and copy over.
-
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. Installclang
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.
-
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. Installclang
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.
@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