I’m new and I want to contribute to this open source project so I have installed the kde-builder environment to start. I did a build of kcalc as mentioned in the tutorial and I got an error on compilation of kcoreaddons. I’m using Ubuntu 25.04 with KDE, I have both gcc and g++ versions 14.2.0 and my system is updated and upgraded.
I found the issue in /home/matdubuisson/kde/log/2025-09-17_01/kcoreaddons/build.log :
(kcoreaddons) Clang: 1 diagnostic messages:
/usr/include/c++/14/cstddef:50:10: fatal: 'stddef.h' file not found
/tmp/bindings_zTWjVG.hpp:1:10: note: in file included from /tmp/bindings_zTWjVG.hpp:1:
/home/matdubuisson/kde/src/kcoreaddons/python/bindings.h:6:10: note: in file included from /home/matdubuisson/kde/src/kcoreaddons/python/bindings.h:6:
/usr/include/x86_64-linux-gnu/qt6/QtCore/QPluginLoader:1:10: note: in file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/QPluginLoader:1:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qpluginloader.h:7:10: note: in file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qpluginloader.h:7:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:14:12: note: in file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:14:
And found the solution on stack overflow (I can’t post the link) where it is just a simple sudo apt install -y clang. I installed gcc and g++ directly through apt but didn’t ask apt to install clang.
But I was wondering if it’s a bug or if I did something wrong ? I did kde-builder --install-distro-packages just before to install dependencies. Maybe clang is missing ? Would it be a good idea to add it ? If yes how can I do it ? Sorry for all these questions, it’s my first time on open-source projects.
clang is a compiler like gcc. You shouldn’t need to have both, but if you do want to use tools like clazy to do auditing of source code then you will need clang (and clang++, in case it’s a separate package).
From the error message it looks like clang was already in use though (the “diagnostic message” is listed as coming from clang), so was this the same error that got you to try installing clang?
As long as you have the base gcc and g++ installed you should have stddef.h as well (it will be in a strange place, under /usr/lib/gcc instead of /usr/include, but gcc and g++ will know to look there as long as you’re actually using those compilers.
You can also just not build the Python bindings, that’s fine too. That can be done by setting -DBUILD_PYTHON_BINDINGS=OFF in the global cmake-options in ~/.config/kde-builder.yaml.
Strangely everything became fine after sudo apt install clang . I tried on my ubuntu25 there are no packages clang++ and clang-dev I think everything is already in clang package.
I found this on incredibuild com : Clang Supports Diverse Clients as the primary goal is to aid incremental compilation. This gives it a better connection to the GUI of IDE. Great care was taken to build and design clang to give it a firm foundation for a new set of C++, Objective C and C development tools.
Clang supports a wide range of language extensions as they are compatible with Microsoft, GCC, and other well-known compilers to enhance functionality via specific features of clang.