Error while building QT6 for cross-compiling
-
Dear all,
I'm into a raspberry pi project, but my board actually can't compile the project itself because it lacks of ram. I'm following this wiki that seemed very accesible to me: https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi
And I got stuck in Building QT6 for host machine step, at line:cmake ../qt5/ -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$HOME/qt-host
First of all the wiki doen't say that I need cmake, but it's obvious I need it. Then goes my error:
Configuring submodule 'qttools' CMake Error at /usr/lib/llvm-13/lib/cmake/clang/ClangTargets.cmake:737 (message): The imported target "clangBasic" references the file "/usr/lib/llvm-13/lib/libclangBasic.a" but this file does not exist. Possible reasons include: * The file was deleted, renamed, or moved to another location. * An install or uninstall procedure did not complete successfully. * The installation package was faulty and contained "/usr/lib/llvm-13/lib/cmake/clang/ClangTargets.cmake" but not all the files it references. Call Stack (most recent call first): /usr/lib/cmake/clang-13/ClangConfig.cmake:20 (include) qttools/cmake/FindWrapLibClang.cmake:14 (find_package) qtbase/cmake/QtFindPackageHelpers.cmake:130 (find_package) qttools/configure.cmake:17 (qt_find_package) qtbase/cmake/QtFeature.cmake:573 (include) qttools/src/CMakeLists.txt:21 (qt_feature_evaluate_features) -- Configuring incomplete, errors occurred!
I'm not attaching the log files because they are very extensive, but if needed I'll copy around here.
My objective is just to complete de wiki and to compile and run my project at the raspi.
Thanks in advance!
-
@guille31794 said in Error while building QT6 for cross-compiling:
/usr/lib/llvm-13/lib/libclangBasic.a
See if installing the package mentioned here fixes your issue: https://askubuntu.com/questions/1220739/llvm-dev-package-missing-libclangbasic
-
@mchinand It seems it worked for this particular file, but now it lacks of:
/usr/lib/llvm-13/lib/libRemoteIndexProto.a
So I'll continue the thread until I can compile.
EDIT:
I don't know why I was missing several packages in clang and llvm in their latest versions. After installing then manually, everything worked fine as it should.
So thank you very much for the idea and help. I used:sudo apt install clang-tools-14 clang-format-14 clang-tidy-14 sudo apt install llvm-14-dev llvm-14-linker-tools llvm-14-tools llvm-14-runtime
And also previous versions, 13 and 12.
-
@guille31794 said in Error while building QT6 for cross-compiling:
First of all the wiki doen't say that I need cmake, but it's obvious I need it. Then goes my error:
From the page you linked:
At its most basic setup, we need at least the following components in a host machine to cross-compile Qt:
...- CMake toolchain. CMake is the recommended build generator for Qt 6. Inside this toolchain file, we will specify in detail about the exact specifications of our cross-compiled Qt build. We will store this toolchain.cmake file on our $HOME directory.