Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed on Ubuntu 22.04 #650

Closed
hien-ngo29 opened this issue Oct 15, 2023 · 9 comments
Closed

Build failed on Ubuntu 22.04 #650

hien-ngo29 opened this issue Oct 15, 2023 · 9 comments

Comments

@hien-ngo29
Copy link

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 
@guihkx
Copy link
Collaborator

guihkx commented Oct 15, 2023

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:

set(CMAKE_AUTORCC ON)

And retry the build steps from the beginning?

@hien-ngo29
Copy link
Author

I followed the steps that you said, but it didn't work. The error was still there, nothing changed

@zjeffer
Copy link
Collaborator

zjeffer commented Oct 15, 2023

Did you delete the build folder before making the change and trying again?

@hien-ngo29
Copy link
Author

Yes, I did

@hien-ngo29
Copy link
Author

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.

@guihkx
Copy link
Collaborator

guihkx commented Oct 15, 2023

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...

@hien-ngo29
Copy link
Author

Well.. I found 1 more way to build this by using Qt 5 instead of Qt 6. By changing this line:

find_package(QT NAMES Qt6 QUIET)

to:

find_package(QT NAMES Qt5 QUIET)

@guihkx
Copy link
Collaborator

guihkx commented Nov 12, 2023

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.

@guihkx
Copy link
Collaborator

guihkx commented May 21, 2024

Assuming the Qt bug report I linked in #650 (comment) 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.

@guihkx guihkx closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants