Failed to build either plasma-workspace or Qt6

I am attempting to build the plasma-workspace project using kde-builder. I am using Arch Linux and have installed the kde-builder-git package from AUR. I then run:

kde-builder workspace

which starts downloading and building various dependencies. However, when it gets to building appstream, it fails trying to link to Qt6 libraries:

# kde-builder running: 'ninja'
# from directory:  /home/xxx/kde/build/appstream
# with environment:  /home/xxx/kde/build/appstream/kde-builder.env
[1/4] Generating compose/AppStreamCompose-1.0.typelib with a custom command
[2/4] Linking target qt/tests/as-test_qt-pool
FAILED: [code=1] qt/tests/as-test_qt-pool  
c++  -o qt/tests/as-test_qt-pool qt/tests/as-test_qt-pool.p/asqt-pool-test.cpp.o -Wl,--as-needed -Wl,--no-undefined '-Wl,-rpath=${install-dir}/${libname}' '-Wl,-rpath,$ORIGIN/..:$
ORIGIN/../../src' -Wl,--start-group qt/libAppStreamQt.so.1.1.2 /usr/lib/libQt6Core.so /usr/lib/libQt6Test.so -Wl,--end-group
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `__truncxfhf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libQt6Test.so: undefined reference to `__eqhf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `std::__exception_ptr::exception_ptr::_M_release()@CXXABI_1.3.13'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `std::condition_variable::wait(std::unique_lock<std::mutex>&)@GLIBCXX_3.4.30'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)@GLIBCXX_3.4.30'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `__truncsfhf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `__extendhfdf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `__truncdfhf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `__extendhfsf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `__cxa_call_terminate@CXXABI_1.3.15'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `std::__exception_ptr::exception_ptr::_M_addref()@CXXABI_1.3.13'
collect2: error: ld returned 1 exit status
[3/4] Linking target qt/tests/as-test_qt-misc
FAILED: [code=1] qt/tests/as-test_qt-misc  
c++  -o qt/tests/as-test_qt-misc qt/tests/as-test_qt-misc.p/asqt-misc-test.cpp.o -Wl,--as-needed -Wl,--no-undefined '-Wl,-rpath=${install-dir}/${libname}' '-Wl,-rpath,$ORIGIN/..:$
ORIGIN/../../src' -Wl,--start-group qt/libAppStreamQt.so.1.1.2 /usr/lib/libQt6Core.so /usr/lib/libQt6Test.so -Wl,--end-group
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `__truncxfhf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libQt6Test.so: undefined reference to `__eqhf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `std::__exception_ptr::exception_ptr::_M_release()@CXXABI_1.3.13'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `std::condition_variable::wait(std::unique_lock<std::mutex>&)@GLIBCXX_3.4.30'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)@GLIBCXX_3.4.30'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `__truncsfhf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `__extendhfdf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `__truncdfhf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `__extendhfsf2@GCC_12.0.0'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `__cxa_call_terminate@CXXABI_1.3.15'
/usr/bin/ld: /usr/lib/libQt6Core.so: undefined reference to `std::__exception_ptr::exception_ptr::_M_addref()@CXXABI_1.3.13'
collect2: error: ld returned 1 exit status
[4/4] Generating docs/api/compose/doc-api-appstream-compose with a custom command
ninja: build stopped: subcommand failed.

# exit code was: 256
/home/xxx/kde/log/2025-11-16_05/appstream/error.log (END)

My suspicion is that I need to build the Qt6 libraries, but if I try to build with kde-builder qt6-set this also fails.

# kde-builder running: 'ninja'
# from directory:  /home/xxx/kde/build/qtbase
# with environment:  /home/xxx/kde/build/qtbase/kde-builder.env
[1/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/mimetypes/qmimemagicrulematcher.cpp.o
[2/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/ipc/qsystemsemaphore_posix.cpp.o
[3/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/ipc/qsharedmemory_systemv.cpp.o
[4/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/ipc/qsystemsemaphore_systemv.cpp.o
[5/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/mimetypes/qmimemagicrule.cpp.o
[6/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/io/qstorageinfo_linux.cpp.o
FAILED: [code=1] src/corelib/CMakeFiles/Core.dir/io/qstorageinfo_linux.cpp.o 
/usr/local/bin/c++ -DBACKTRACE_HEADER=\"execinfo.h\" -DCore_EXPORTS -DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=1 -DQT_MOC_COMPAT -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHANGE -DQT_NO_QPAIR -DQT_NO_QSNPRINTF -DQT_NO_STD_FORMAT_SUPPORT -DQT_NO_USING_NAMESPACE -DQT_TYPESAFE_FLAGS -DQT_USE_NODISCARD_FILE_OPEN -DQT_USE_QSTRINGBUILDER -D_GLIBCXX_ASSERTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/mjq/kde/build/qtbase/src/corelib/Core_autogen/include -I/home/mjq/kde/build/qtbase/include -I/home/mjq/kde/build/qtbase/include/QtCore -I/home/mjq/kde/src/qtbase/src/corelib -I/home/mjq/kde/build/qtbase/src/corelib -I/home/mjq/kde/build/qtbase/src/corelib/global -I/home/mjq/kde/build/qtbase/src/corelib/kernel -I/home/mjq/kde/src/qtbase/src/corelib/../3rdparty/tinycbor/src -I/home/mjq/kde/build/qtbase/include/QtCore/6.9.3 -I/home/mjq/kde/build/qtbase/include/QtCore/6.9.3/QtCore -I/home/mjq/kde/src/qtbase/src/corelib/../3rdparty/forkfd -I/home/mjq/kde/build/qtbase/src/corelib/.rcc -I/home/mjq/kde/src/qtbase/mkspecs/linux-g++ -isystem /usr/include/glib-2.0 -isystem /usr/lib/glib-2.0/include -pipe -g -DNDEBUG -O3 -std=gnu++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -U_FORTIFY_SOURCE -Wsuggest-override -fcf-protection=full -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection -fexceptions -Winvalid-pch -include /home/mjq/kde/build/qtbase/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx -MD -MT src/corelib/CMakeFiles/Core.dir/io/qstorageinfo_linux.cpp.o -MF src/corelib/CMakeFiles/Core.dir/io/qstorageinfo_linux.cpp.o.d -o src/corelib/CMakeFiles/Core.dir/io/qstorageinfo_linux.cpp.o -c /home/mjq/kde/src/qtbase/src/corelib/io/qstorageinfo_linux.cpp
/home/mjq/kde/src/qtbase/src/corelib/io/qstorageinfo_linux.cpp: In function ‘quint64 mountIdForPath(int)’:
/home/mjq/kde/src/qtbase/src/corelib/io/qstorageinfo_linux.cpp:323:19: error: ‘struct statx’ has no member named ‘stx_mnt_id’; did you mean ‘stx_uid’?
  323 |         return st.stx_mnt_id;
      |                   ^~~~~~~~~~
      |                   stx_uid
[7/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/serialization/qcborstreamwriter.cpp.o
[8/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/mimetypes/qmimeglobpattern.cpp.o
[9/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/mimetypes/qmimetype.cpp.o
[10/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/serialization/qcborstreamreader.cpp.o
[11/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/kernel/qpermissions.cpp.o
[12/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/mimetypes/qmimetypeparser.cpp.o
[13/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/mimetypes/qmimedatabase.cpp.o
[14/1380] Building CXX object src/corelib/CMakeFiles/Core.dir/mimetypes/qmimeprovider.cpp.o
[15/1380] Building CXX object qmake/CMakeFiles/qmake.dir/generators/mac/pbuilder_pbx.cpp.o
ninja: build stopped: subcommand failed.

# exit code was: 256

I am new to this so I am not even sure what step to take next. ANy help would be appreciated.

I am using Arch Linux and have installed the kde-builder-git package from AUR.

Please follow exact instructions how to install and use kde-builder and everything should work fine.

https:// develop .kde .org /docs/getting-started/building/kde-builder-setup/#set-up-kde-builder

Also, as described there - start from compiling kcalc to check if everything is setup properly.

Hi syriusz,

I did start again from scratch following the instructions exactly, and have made better progress. I have now managed to build the workspace group.

However, I’m still having no luck compiling the Qt libraries. Now, when I run kde-builder qt6-set, it fails to build qttools with several modules having the same error. This is one example:

[125/421] Building CXX object src/linguist/lupdate/CMakeFiles/lupdate.dir/main.cpp.o
FAILED: [code=1] src/linguist/lupdate/CMakeFiles/lupdate.dir/main.cpp.o 
/usr/bin/c++ -DLUPDATE_CLANG_VERSION_MAJOR=21 -DLUPDATE_CLANG_VERSION_MINOR=1 -DLUPDATE_CLANG_VERSION_PATCH=5 -DLUPDATE_CLANG_VERSION_STR=\"\"21.1.5\"\" -DQT_CORE_LIB -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_NETWORK_LIB -DQT_NO_AS_CONST=1 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT=1 -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_NO_FOREACH -DQT_NO_FOREACH=1 -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHANGE -DQT_NO_QSNPRINTF -DQT_NO_STD_FORMAT_SUPPORT -DQT_QMLINTEGRATION_LIB -DQT_QML_LIB -DQT_TOOLS_LIB -DQT_USE_QSTRINGBUILDER -D_GLIBCXX_ASSERTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/mjq/kde/build/qttools/src/linguist/lupdate/lupdate_autogen/include -I/home/mjq/kde/src/qttools/src/linguist/lupdate -I/home/mjq/kde/build/qttools/src/linguist/lupdate -I/home/mjq/kde/src/qttools/src/linguist/lupdate/../shared -I/home/mjq/kde/build/qttools/include -I/home/mjq/kde/build/qttools/include/QtTools -I/home/mjq/kde/src/qttools/src/global -I/home/mjq/kde/build/qttools/src/global -I/home/mjq/kde/build/qttools/include/QtTools/6.9.3 -I/home/mjq/kde/build/qttools/include/QtTools/6.9.3/QtTools -isystem /home/mjq/kde/qt/include/QtCore -isystem /home/mjq/kde/qt/include -isystem /home/mjq/kde/qt/mkspecs/linux-g++ -isystem /home/mjq/kde/qt/include/QtCore/6.9.3 -isystem /home/mjq/kde/qt/include/QtCore/6.9.3/QtCore -isystem /home/mjq/kde/qt/include/QtQml -isystem /home/mjq/kde/qt/include/QtQmlIntegration -isystem /home/mjq/kde/qt/include/QtNetwork -isystem /home/mjq/kde/qt/include/QtQml/6.9.3 -isystem /home/mjq/kde/qt/include/QtQml/6.9.3/QtQml -pipe -g -DNDEBUG -O2 -std=gnu++17 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -fPIC -U_FORTIFY_SOURCE -Wsuggest-override -fcf-protection=full -D_FORTIFY_SOURCE=2 -ftrivial-auto-var-init=pattern -fstack-protector-strong -fstack-clash-protection -fno-exceptions -MD -MT src/linguist/lupdate/CMakeFiles/lupdate.dir/main.cpp.o -MF src/linguist/lupdate/CMakeFiles/lupdate.dir/main.cpp.o.d -o src/linguist/lupdate/CMakeFiles/lupdate.dir/main.cpp.o -c /home/mjq/kde/src/qttools/src/linguist/lupdate/main.cpp
In file included from /home/mjq/kde/src/qttools/src/linguist/lupdate/main.cpp:7:
/home/mjq/kde/src/qttools/src/linguist/lupdate/cpp_clang.h: In member function ‘clang::SourceLocation TranslationRelatedStore::callLocation(const clang::SourceManager&)’:
/home/mjq/kde/src/qttools/src/linguist/lupdate/cpp_clang.h:154:18: error: ‘class clang::FileManager’ has no member named ‘getFile’; did you mean ‘getFileRef’?
  154 |                 .getFile(lupdateLocationFile.toStdString());
      |                  ^~~~~~~
      |                  getFileRef

If you need any further information please let me know, and thanks for your help.

You’re on Arch, you don’t need to build Qt.

Herzenschein, I know I don’t need to, but I want to be able to build everything from the ground up. This is an experimental installation just for learning the Qt and plasma code base. It’s not for a working system. Otherwise I would just install the plasma-desktop package of Arch.

You don’t need to build Qt to learn about the Plasma codebase at all.

If you actually want to hack on Qt then it makes sense to build Qt, yeah.

The error you got looks like a symbol mismatch: some code in qtlinguist is trying to use a function that’s not available in the development library for Clang that’s present on your system. This can happen for multiple reasons, I’d first suspect of not having the right Clang version installed.

Thanks for your response Herzenschein, I’m afraid I feel like I’m out of my depth here. I want to ensure that I have all build dependencies correct for each project I’m trying to build, but feel like I’m missing some essential knowledge.

I was under the assumption that kde-builder --install-distro-packages would resolve all build dependencies for building KDE software. Is this incorrect? In this case, how would I be able to find out the dependencies of a particular project?

The section on installing build dependencies in the docs does not have any information for my distribution, and so advises on using build errors to determine what the dependencies are. But without a familiarity with the code base I don’t know how one determines the dependencies not satisfied from such a cryptic error message. You say it may be an incorrect version of Clang, but how can you tell this? And how would I know which version to install? I’ve got the latest version for my distribution.

And when I build using kde-builder, how do I know what release I am pulling? Does it pull the most up to date development branch? I only want a stable release that’s not changing, just to build and explore the code.

It is a best effort.
For the most commonly-used distro by devs, this will work since they will likely fix issues.
For others this will drift as new dependencies might not be added to the list.
If you see a missing dependency feel free to open a merge request !
They are defined here: distro-dependencies · master · Sysadmin / Git Repository Metadata · GitLab

kde-builder just needs to be able to recognize its base (arch, debian, etc…)
You can how it was done for manjaro: Add Manjaro Linux Support (!27) · Merge requests · SDK / KDE Builder · GitLab

It is current development version by default.
Once it is checked out and build, you can change branch and rebuild.
If you only want to build the stable version you probably don’t need the dependencies and specify the tag: use kde-builder workspace --revision Plasma/6.5 --no-include-dependencies.

This is documented: 4.3. Supported command-line parameters — KDE Builder documentation

You are not expected to build Qt yourself if you just want to get started building KDE stuff. If you just use your distribution’s Qt everything will get way easier. I’ve been trying to steer you away from building Qt for the last two messages. :smiley:

I don’t know myself what actual issue you have there, but the error message itself is actually pretty common if you’re ever dealt with C++ before. If you’ve never seen it before, you probably shouldn’t be compiling Qt yourself. Ease yourself into development using the tutorials, don’t dive head first into something complex like that, otherwise you’ll lose motivation.

A particularity of building Qt with kde-builder is that it builds from the master branch. Qt themselves don’t do that, they use specific commits for their submodules (though their build process is more convoluted than ours). Both ways may lead to failed builds since they’re both for development purposes, and debugging that is usually a thing for more experienced developers. A more guaranteed way to build Qt is to build a specific version (but again, if you’re just starting, just use your distro packages).

1 Like

Thank you both for your replies. I shall put aside building Qt for now, I guess I thought it would be easier, so I’ll take smaller steps for now.

1 Like