Build failed on Ubuntu 22.04
I followed the build instruction on /docs/build_on_linux.md. It was configured successfully until I compiled it with make.
Here's the log:
[ 15%] Built target Notes_tooling
[ 15%] Generating .rcc/qmlcache/Notes_qmlcache_loader.cpp
/usr/lib/qt6/libexec/qmlcachegen: symbol lookup error: /usr/lib/qt6/libexec/qmlcachegen: undefined symbol: qt_resourceFeatureZstd, version Qt_6
make[2]: *** [CMakeFiles/Notes_autogen.dir/build.make:79: .rcc/qmlcache/Notes_qmlcache_loader.cpp] Error 127
make[1]: *** [CMakeFiles/Makefile2:330: CMakeFiles/Notes_autogen.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
Note that I have installed all the needed packages with the command:
sudo apt install cmake gcc git qt6-base-private-dev qt6-declarative-dev libgl-dev libqt6network6 libqt6sql6 libqt6widgets6 qml6-module-qtqml-workerscript qml6-module-qtquick-controls qml6-module-qtquick-layouts qml6-module-qtquick-particles qml6-module-qtquick-templates qml6-module-qtquick-window qt6-qpa-plugins
Hardware and Software info:
OS: Ubuntu 22.04.3 LTS x86_64
Kernel: 5.15.0-86-generic
Uptime: 3 hours, 14 mins
Packages: 3753 (dpkg), 4 (flatpak),
Shell: bash 5.1.16
Resolution: 1920x1080
DE: GNOME 42.9
Terminal: gnome-terminal
CPU: 12th Gen Intel i7-1255U (12) @
GPU: NVIDIA GeForce MX550
GPU: Intel Device 4628
Memory: 2903MiB / 7430MiB
Seems to be related to this bug:
https://bugreports.qt.io/browse/QTBUG-101353
Can you try adding this line:
set(CMAKE_AUTORCC_OPTIONS "--no-zstd")
Below this line:
https://github.com/nuttyartist/notes/blob/10bed3427934456711a7e49b05ecb47fff617666/CMakeLists.txt#L35
And retry the build steps from the beginning?
I followed the steps that you said, but it didn't work. The error was still there, nothing changed
Did you delete the build folder before making the change and trying again?
Yes, I did
Somehow the code was successfully built if I installed Qt by the Qt binaries installer (Not by source.list or any Linux package managers) So basically, my problem has been resolved for now.
Somehow the code was successfully built if I installed Qt by the Qt binaries installer (Not by source.list or any Linux package managers)
That worked because official Qt binaries were likely built with zstd support, while Qt binaries from Ubuntu repositories were not (apparently).
I'm not sure why tweaking CMAKE_AUTORCC_OPTIONS didn't work...
Well.. I found 1 more way to build this by using Qt 5 instead of Qt 6. By changing this line: https://github.com/nuttyartist/notes/blob/10bed3427934456711a7e49b05ecb47fff617666/CMakeLists.txt#L64 to:
find_package(QT NAMES Qt5 QUIET)
I found 1 more way to build this by using Qt 5 instead of Qt 6
Just so you know, you don't have to edit that file manually. You can invoke cmake with -DUSE_QT_VERSION=5, e.g.:
cmake -B build -USE_QT_VERSION=5 -DCMAKE_BUILD_TYPE=Release
Just keep in mind that the Qt 5 build currently lacks some features compared to a Qt 6 build.
Assuming the Qt bug report I linked in https://github.com/nuttyartist/notes/issues/650#issuecomment-1763323410 is the root cause of this, I believe this one can be finally closed, because that bug has been fixed in Qt 6.2.2, and Ubuntu 22.04 already has Qt 6.2.4.
But feel free to reopen if the issue still persists.