(Cross-)Compiler Qt6.8 for Ubuntu and Raspberry Pi
Solved
General and Desktop
-
wrote on 25 Jul 2024, 09:42 last edited by
Hello all,
I try to cross-compile Qt6.8 on my host machine Ubuntu 20.04 64-bit for Raspberry Pi 4B Bookworm 32-bit.
First I tried to compile Qt6.8 for the host machine itself.
I think I need another compiler for host-build and maybe also for raspi-build.
Can someone help me?After hours of compilation I got following errors:
.. -- Build files have been written to: /home/user/qt-hostbuild/qtwebengine/src/gn [10860/12932] Performing build step for 'gn' [0/1] Generating gn ninja: Entering directory `/home/user/qt-hostbuild/qtwebengine/src/gn/Release' [1/200] CXX src/base/command_line.o FAILED: src/base/command_line.o /usr/bin/c++ -MMD -MF src/base/command_line.o.d -I../../../../../qt5/qtwebengine/src/3rdparty/gn/src -I. -DNO_LAST_COMMIT_POSITION -DNDEBUG -O3 -fdata-sections -ffunction-sections -Werror -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -fno-rtti -fdiagnostics-color -Wall -Wextra -Wno-unused-parameter -Wextra-semi -Wundef -Wno-redundant-move -Wno-restrict -Wno-deprecated-copy -Wno-implicit-fallthrough -Wno-redundant-move -Wno-unused-variable -Wno-format -Wno-strict-aliasing -Wno-cast-function-type -std=gnu++20 -c ../../../../../qt5/qtwebengine/src/3rdparty/gn/src/base/command_line.cc -o src/base/command_line.o c++: error: unrecognized command line option ‘-std=gnu++20’; did you mean ‘-std=gnu++2a’? [2/200] CXX src/base/environment.o FAILED: src/base/environment.o /usr/bin/c++ -MMD -MF src/base/environment.o.d -I../../../../../qt5/qtwebengine/src/3rdparty/gn/src -I. -DNO_LAST_COMMIT_POSITION -DNDEBUG -O3 -fdata-sections -ffunction-sections -Werror -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -fno-rtti -fdiagnostics-color -Wall -Wextra -Wno-unused-parameter -Wextra-semi -Wundef -Wno-redundant-move -Wno-restrict -Wno-deprecated-copy -Wno-implicit-fallthrough -Wno-redundant-move -Wno-unused-variable -Wno-format -Wno-strict-aliasing -Wno-cast-function-type -std=gnu++20 -c ../../../../../qt5/qtwebengine/src/3rdparty/gn/src/base/environment.cc -o src/base/environment.o c++: error: unrecognized command line option ‘-std=gnu++20’; did you mean ‘-std=gnu++2a’? [3/200] CXX src/base/files/file.o FAILED: src/base/files/file.o /usr/bin/c++ -MMD -MF src/base/files/file.o.d -I../../../../../qt5/qtwebengine/src/3rdparty/gn/src -I. -DNO_LAST_COMMIT_POSITION -DNDEBUG -O3 -fdata-sections -ffunction-sections -Werror -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -fno-rtti -fdiagnostics-color -Wall -Wextra -Wno-unused-parameter -Wextra-semi -Wundef -Wno-redundant-move -Wno-restrict -Wno-deprecated-copy -Wno-implicit-fallthrough -Wno-redundant-move -Wno-unused-variable -Wno-format -Wno-strict-aliasing -Wno-cast-function-type -std=gnu++20 -c ../../../../../qt5/qtwebengine/src/3rdparty/gn/src/base/files/file.cc -o src/base/files/file.o c++: error: unrecognized command line option ‘-std=gnu++20’; did you mean ‘-std=gnu++2a’? [4/200] CXX src/base/files/file_enumerator.o FAILED: src/base/files/file_enumerator.o /usr/bin/c++ -MMD -MF src/base/files/file_enumerator.o.d -I../../../../../qt5/qtwebengine/src/3rdparty/gn/src -I. -DNO_LAST_COMMIT_POSITION -DNDEBUG -O3 -fdata-sections -ffunction-sections -Werror -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -fno-rtti -fdiagnostics-color -Wall -Wextra -Wno-unused-parameter -Wextra-semi -Wundef -Wno-redundant-move -Wno-restrict -Wno-deprecated-copy -Wno-implicit-fallthrough -Wno-redundant-move -Wno-unused-variable -Wno-format -Wno-strict-aliasing -Wno-cast-function-type -std=gnu++20 -c ../../../../../qt5/qtwebengine/src/3rdparty/gn/src/base/files/file_enumerator.cc -o src/base/files/file_enumerator.o c++: error: unrecognized command line option ‘-std=gnu++20’; did you mean ‘-std=gnu++2a’? [5/200] CXX src/base/files/file_path_constants.o FAILED: src/base/files/file_path_constants.o /usr/bin/c++ -MMD -MF src/base/files/file_path_constants.o.d -I../../../../../qt5/qtwebengine/src/3rdparty/gn/src -I. -DNO_LAST_COMMIT_POSITION -DNDEBUG -O3 -fdata-sections -ffunction-sections -Werror -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -fno-rtti -fdiagnostics-color -Wall -Wextra -Wno-unused-parameter -Wextra-semi -Wundef -Wno-redundant-move -Wno-restrict -Wno-deprecated-copy -Wno-implicit-fallthrough -Wno-redundant-move -Wno-unused-variable -Wno-format -Wno-strict-aliasing -Wno-cast-function-type -std=gnu++20 -c ../../../../../qt5/qtwebengine/src/3rdparty/gn/src/base/files/file_path_constants.cc -o src/base/files/file_path_constants.o c++: error: unrecognized command line option ‘-std=gnu++20’; did you mean ‘-std=gnu++2a’? [6/200] CXX src/base/files/file_path.o FAILED: src/base/files/file_path.o /usr/bin/c++ -MMD -MF src/base/files/file_path.o.d -I../../../../../qt5/qtwebengine/src/3rdparty/gn/src -I. -DNO_LAST_COMMIT_POSITION -DNDEBUG -O3 -fdata-sections -ffunction-sections -Werror -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -pthread -pipe -fno-exceptions -fno-rtti -fdiagnostics-color -Wall -Wextra -Wno-unused-parameter -Wextra-semi -Wundef -Wno-redundant-move -Wno-restrict -Wno-deprecated-copy -Wno-implicit-fallthrough -Wno-redundant-move -Wno-unused-variable -Wno-format -Wno-strict-aliasing -Wno-cast-function-type -std=gnu++20 -c ../../../../../qt5/qtwebengine/src/3rdparty/gn/src/base/files/file_path.cc -o src/base/files/file_path.o c++: error: unrecognized command line option ‘-std=gnu++20’; did you mean ‘-std=gnu++2a’? ninja: build stopped: subcommand failed. FAILED: gn /home/user/qt-hostbuild/qtwebengine/src/gn/gn cd /home/user/qt-hostbuild/qtwebengine/src/gn && /usr/bin/python3.8 /home/user/qt5/qtwebengine/src/3rdparty/gn/build/gen.py --no-last-commit-position --out-path /home/user/qt-hostbuild/qtwebengine/src/gn/Release --cc /usr/bin/cc --cxx /usr/bin/c++ --ld /usr/bin/c++ --platform linux --ar /usr/bin/ar --qt-version 6.8.0.qtwebengine.qt.io && /usr/bin/ninja -C /home/user/qt-hostbuild/qtwebengine/src/gn/Release gn ninja: build stopped: subcommand failed. [10865/12932] Running syncqt.cpp for module: QtProtobuf FAILED: qtwebengine/src/gn/src/gn-stamp/gn-build /home/user/qt-hostbuild/qtwebengine/src/gn/src/gn-stamp/gn-build cd /home/user/qt-hostbuild/qtwebengine/src/gn && /usr/local/bin/cmake --build . && /usr/local/bin/cmake -E touch /home/user/qt-hostbuild/qtwebengine/src/gn/src/gn-stamp/gn-build [10873/12932] Building CXX object qtwebchannel/src/webchannel/CMakeFiles/WebChannel.dir/cmake_pch.hxx.gch ninja: build stopped: subcommand failed.
-
You need a compiler which is supported by Qt 6.8.
You can see what versions are required here https://doc.qt.io/qt-6/supported-platforms.html
For cross compilation you need a cross-compiler and sysroot. https://doc.qt.io/qt-6/qt-edu-raspberry-pi.html -
wrote on 26 Jul 2024, 06:25 last edited by
Thank you.
I installed gcc-11 and g++-11 and it worked. -
1/3