0

I'm trying to build QT 5.15 statically from source out of tree with GUI enabled and have problems with XCB.

I am trying to build on Ubuntu 20.04 and used https://wiki.qt.io/Building_Qt_5_from_Git as reference and used apt-get install on all packages on the page.

To repeat my build, basically, I do this:

qt_version='5.15'
my_install_dir=$(pwd)
include_dir="${my_install_dir}/include"
lib_dir="${my_install_dir}/lib"
qtbase_github_url="https://github.com/qt/qtbase.git"
qtbase_github_tag="$(grep -Eom1 "v${qt_version}.([0-9]{1,2})" <(curl "https://github.com/qt/qtbase/releases"))"
app_name=qtbase
app_url="${app_name}_url"
app_github_url="${app_name}_github_url"
custom_flags_set() {
    CXXFLAGS="${optimize/*/$optimize }-std=c++17"
    CPPFLAGS="${optimize/*/$optimize }--static -static -I${include_dir}"
    LDFLAGS="${optimize/*/$optimize }--static -static -Wl,--no-as-needed -L${lib_dir} -lpthread -pthread"
}
github_tag="${app_name}_github_tag"
url_github="${!app_github_url}"
folder_name="${my_install_dir}/${app_name}"
folder_inc="${my_install_dir}/include/${app_name}"
if [[ ! -d "${folder_name}" ]]; then
    git clone --no-tags --single-branch --branch "${!github_tag}" --shallow-submodules --recurse-submodules -j"$(nproc)" --depth 1 "${url_github}" "${folder_name}"
    mkdir -p "${folder_name}${subdir}"
    mkdir -p "${my_install_dir}/logs"
fi
cd "${folder_name}${subdir}"

custom_flags_set
./configure -prefix "${my_install_dir}" "${icu}" -xcb -opensource -confirm-license -release -openssl-linked -static -c++std c++17 -qt-pcre -no-iconv -no-feature-glib -no-feature-opengl -no-feature-dbus -no-feature-testlib -no-compile-examples -I "${include_dir}" -L "${lib_dir}" QMAKE_LFLAGS="${LDFLAGS}" 2>&1 | tee "${my_install_dir}/logs/${app_name}.log.txt"
make -j"$(nproc)" 2>&1 | tee -a "${my_install_dir}/logs/${app_name}.log.txt"

And I get the following error, which I cannot solve:

ERROR: Feature 'xcb' was enabled, but the pre-condition 'features.thread && libs.xcb && tests.xcb_syslibs && features.xkbcommon-x11' failed.

The condition above can be found in src/gui/configure.json, but I do not not know which part of the AND condition fails and how to get more information out of this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.