Kde-builder kcalc (potential missing dependency)

Hello,

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.

Thank you for your time,
Good evening,

Maybe it needs to be added here?

scripts/initial_setup.sh · master · SDK / KDE Builder · GitLab

@Ashark ^

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.

This is about Python bindings, clang is needed as a build dependency for them.

distro-dependencies/debian.ini · master · Sysadmin / Git Repository Metadata · GitLab needs to be updated to include them. You could even attempt to send an MR there if you want. In the meantime, just installing clang (maybe clang-dev?) should work, as you found out. You didn’t do anything wrong.

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.

Hello,

At first thank all for your answers

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.

I’m going to try a pull-request for it.

Thanks again to all

In that file, there are only dependencies of kde-builder itself.
Adding packages is done in the repo-metadata, as @Herzenschein stated.