Nova Flow OS
KDE Developer Platform
KDE Developer Platform
  • KDE Developer Platform
    • Getting started
      • Building KDE software
        • KDE software
        • Where to find the development team
        • Learning more
        • Choose what to work on
        • Source code cross-referencing
        • Installing build dependencies
        • Set up a development environment
        • Building KDE software with kdesrc-build
        • Basic troubleshooting
        • Tips and tricks
        • IDE Configuration
          • Setting up an IDE for KDE development
          • Visual Studio Code
          • Qt Creator
          • Kate
          • KDevelop
          • CLion
          • Sublime Text
        • Building KDE software manually
        • Building KDE software with distrobox and podman
      • Kirigami
        • KDE is ours
        • Setting up and getting started
        • Explaining pages
        • Layouts, ListViews, and Cards
        • Adding actions
        • Adding a dialog
        • Using separate files
        • Next steps
        • Colors and themes in Kirigami
        • Typography
        • Actions based components
        • Page rows and page stacks
        • Scrollable pages and list views
        • Cards
        • Drawers
        • Chips
        • Dialog types
        • Controls and interactive elements
        • Form layouts
        • Inline messages
        • Action toolbars
        • Progress bars and indicators
        • List views
        • Understanding CMakeLists
        • Figuring out main.cpp
        • Connect logic to your QML user interface
        • Connect models to your QML user interface
        • About page
        • Introduction to Kirigami Addons
        • FormCard About pages
        • Form delegates in your settings pages
      • KXmlGui
        • Getting started with KXmlGui
        • Hello World!
        • Creating the main window
        • Using actions
        • Saving and loading
        • Command line interface
      • Python with Kirigami
        • Apps with QML and Python
        • Your first Python + Kirigami application
        • Creating a Python package
        • Creating a Flatpak
      • Common programming mistakes
      • Adding a new KDE project
    • Features
      • Icons
      • Configuration
        • The KConfig Framework
        • Introduction to KConfig
        • Using KConfig XT
        • KDE Frameworks 6 porting guide
        • Settings module (KCM) development
        • KConfigDialog
      • D-Bus
        • What is D-Bus practically useful for?
        • Introduction to D-Bus
        • Accessing D-Bus interfaces
        • Intermediate D-Bus
        • Creating D-Bus interfaces
        • Using custom types with D-Bus
        • D-Bus autostart services
      • Create your own mouse cursor theme
      • Session management
      • Archives
      • Desktop file
      • KAuth
        • Privilege Escalation
        • Using actions in your applications
      • KIdleTime
      • Akonadi: personal information management
        • Debugging Akonadi Resources
        • Using Akonadi in applications
      • Concurrent programming
      • Solid
      • Sonnet
    • Plasma themes and plugins
      • Getting started
      • Plasma Widget tutorial
        • How to create a plasmoid
        • Setup
        • Porting Plasmoids to KF6
        • Testing
        • QML
        • Plasma's QML API
        • Widget Properties
        • Configuration
        • Translations / i18n
        • Examples
        • C++ API
      • KWin Effects
      • Plasma Desktop scripting
        • Javascript Interaction With Plasma Shells
        • Templates
        • Examples
        • API documentation
        • Configuration keys
      • Plasma Style tutorial
        • Creating a Plasma Style quickstart
        • Understanding Plasma Styles
        • SVG elements and Inkscape
        • Background SVG format
        • System and accent colors
        • Theme elements reference
        • Porting themes to Plasma 5
        • Porting themes to Plasma 6
      • Aurorae window decorations
      • KWin scripting tutorial
        • Quick start
        • KWin scripting API
      • Wallpapers
      • Plasma comic
        • Tutorial
        • Testing and debugging
        • Examples
      • Create a custom Window Switcher
      • KRunner C++ Plugin
        • Basic Anatomy of a Runner
        • KRunner metadata format
    • Applications
      • Creating sensor faces
      • Dolphin
        • Creating Dolphin service menus
      • Kate
        • Kate plugin tutorial
      • KMines
        • Making a KMines theme
      • Writing tests
        • Appium automation testing
    • Packaging
      • Android
        • KDE on Android
        • Building applications for Android
        • Packaging and publishing applications for Android
        • Publishing on Google Play
          • Introduction
          • Packaging your app
          • Adding your app to Google Play
          • Publishing your app
          • Releasing new versions of old apps
        • Porting applications to Android
          • Basic porting
          • Making applications run well on Android
          • Metadata
      • Windows
        • Packaging and publishing applications for Windows
        • Publish your app in the Microsoft Store
          • Packaging your app for the Microsoft Store
          • Submitting your app to the Microsoft Store
      • Plasma Mobile
        • KDE on mobile devices
        • Porting a new device to Plasma Mobile
        • KDE Telephony stack
          • General Overview
          • Kernel layer
          • System daemons
            • General overview
            • Developing Telephony functionality
            • ModemManager Telephony functions
          • Session daemons
          • QML declarative plugin layer
          • KDE application layer
        • Execute applications
      • Distributing KDE software as Flatpak
        • Your first Flatpak
        • Extending your package
        • Nightly Flatpaks and Flathub
        • Testing your Flatpak
    • System administration
      • Shell scripting with KDE dialogs
      • Kiosk: Simple configuration management for large deployment
        • Abstract
        • Introduction to Kiosk
        • Kiosk keys
    • Contribute to the documentation
    • About
      • Readme
      • License
        • Creative Commons Attribution-ShareAlike 4.0 International
        • GNU General Public License 3.0 or later
Powered by GitBook
On this page
  • How to install all the build dependencies of one package
  • Using build errors to find missing dependencies
  1. KDE Developer Platform
  2. Getting started
  3. Building KDE software

Installing build dependencies

What to do when you are missing dependencies

PreviousSource code cross-referencingNextSet up a development environment

Last updated 8 months ago

If you have any trouble getting things to build due to missing 3rd-party package dependencies, read on to learn what to do. If this guide does not manage to solve your compilation problems, be sure to .

How to install all the build dependencies of one package

Often the simplest solution to the problem of missing dependencies is just to install all its required packages at once without needing to search for each dependency individually.

Because most distributions keep track of package dependencies by using source packages, they also provide their own built-in commands to easily install all the build dependencies of each package.

While these commands will not always install all dependencies you will need when compiling KDE software (for example, when compiling with , where the software is always changing), they will make your dependency resolution faster.

Debian, Ubuntu, Kubuntu, KDE neon

All the build packages known by the package you want to build can be installed with apt build-dep:

sudo apt build-dep dolphin

openSUSE

All the build packages known by the package you want to build can be installed with zypper source-install --build-deps-only:

sudo zypper --plus-content repo-source source-install --build-deps-only dolphin

Note that temporarily enabling the source repositories so that build dependencies can be found is not automatic.

The --plus-content option will make zypper temporarily enable it to get the info it needs.

Fedora

All the build packages known by the package you want to build can be installed with dnf builddep:

sudo dnf builddep dolphin

Note that builddep will temporarily enable the source repositories so that build dependencies can be found.

Using build errors to find missing dependencies

Whenever you attempt to compile a project and it fails to build, most of the time this is caused by a missing dependency.

Let's say you see the following error when compiling a project:

-- Could NOT find KF6TextWidgets (missing: KF6TextWidgets_DIR)
-- Could NOT find KF6TextWidgets: found neither KF6TextWidgetsConfig.cmake nor kf6textwidgets-config.cmake
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find KF6 (missing: TextWidgets)

This error is provided by CMake and it means you are missing the KDE Frameworks 6 library KTextWidgets.

And let's say instead you see the following error when compiling a project:

Build-time dependency gi-docgen found: NO (tried pkgconfig and cmake)

docs/api/meson.build:5:15: ERROR: Dependency "gi-docgen" not found, tried pkgconfig and cmake

Meson projects typically prefer using pkgconfig over CMake package configuration files.

The error here states that Meson could not find the pkgconfig for gi-docgen (most likely a file with the extension ".pc") or the CMake file (most likely a file with the extension ".cmake") that contains "gi-docgen" case insensitively in name.

Generic search

There are two types of dependencies, build dependencies and runtime dependencies. The distribution package names for build dependencies usually begin with lib and/or end in -dev or -devel, whereas runtime dependencies usually just start with lib.

For build dependencies you will likely only need packages that end in -dev or -devel, but in some rare cases you might need to install packages starting with lib too.

In this case, KF6TextWidgets is a build dependency.

The main way to find the package that provides KF6TextWidgets is to grab the name of the library, KF6TextWidgets, strip it from the KF6 part, and search for it in your package manager:

  • Debian and derivatives: sudo apt search textwidgets

  • openSUSE: sudo zypper search textwidgets

  • Fedora: sudo dnf search textwidgets

  • Arch: sudo pacman -Ss textwidgets

  • FreeBSD: sudo pkg search textwidgets

Just searching for the component usually reveals the right package name, although it ultimately amounts to guessing or trial-and-error.

The usual pattern you will find for dependency packages looks like this:

  • Debian and derivatives: lib<packagename>-dev or <packagename>-dev

  • openSUSE and Fedora: kf6-<packagename>-devel or libKF6<PackageName>

  • Arch: <packagename>

You can also use web shortcuts provided by KRunner, which will open the package search website for each distribution.

Finding specific packages using CMake package configuration files

A more efficient way is to use the functionality provided by your package manager to search for the CMake config file:

  • Debian and derivatives: apt-file find KF6TextWidgetsConfig.cmake

  • openSUSE: zypper what-provides 'cmake(KF6TextWidgets)'

  • Fedora: dnf provides 'cmake(KF6TextWidgets)'

  • Arch: pkgfile KF6TextWidgetsConfig.cmake

Fedora and openSUSE come with this functionality by default. On Debian, you will need to install apt-file manually. On Arch, pkgfile.

If while using apt-file you get an error similar to the following (in this example, Qt6WaylandScanner):

The imported target "Qt6::qtwaylandscanner" references the file
     "/usr/lib/qt6/libexec/qtwaylandscanner"
but this file does not exist.

You can run this to see what package contains this file:

apt-file find /usr/lib/qt6/libexec/qtwaylandscanner

You will get the following output:

qt6-wayland-dev-tools: /usr/lib/qt6/libexec/qtwaylandscanner

So the package you need to install is qt6-wayland-dev-tools.

Finding specific packages using pkgconfig files

Similarly to the above, certain distributions also allow to query for packages using pkgconfig files:

  • openSUSE: zypper what-provides 'pkgconfig(gi-docgen)'

  • Fedora: dnf provides 'pkgconfig(gi-docgen)'

Finding missing executables

If the CMake error looks like the following:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Sass (missing: Sass_EXECUTABLE)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindSass.cmake:48 (find_package_handle_standard_args)
  CMakeLists.txt:31 (find_package)

The error here states that CMake could not find the executable named "sass" (most likely a file "/usr/bin/sass").

To solve this, you can specifically search for the executable in distribution packages:

  • Debian and derivatives: apt-file search /usr/bin/sass

  • Fedora: sudo dnf provides sass

  • openSUSE: sudo zypper search --provides /usr/bin/sass

  • Arch: sudo pacman -F /usr/bin/sass

  • FreeBSD: sudo pkg provides sass

Click here to set up pkg-provides on FreeBSD

Once you run pkg provides, if you face the error:

makeinfo: not found WARNING: 'makeinfo' is missing on your system.

This means you are missing the provides plugin:

sudo pkg install pkg-provides

Uncomment the following lines in /usr/local/etc/pkg.conf and add pkg-provides to the supported plugin list:

PKG_PLUGINS_DIR = "/usr/local/lib/pkg/";
PKG_ENABLE_PLUGINS = true;
PLUGINS [ provides ];

To confirm it is working:

sudo pkg plugins
# NAME       DESC                                          VERSION
# provides   A plugin for querying which package provides a particular file 0.7.3
sudo pkg provides -u
sudo pkg provides bin/makeinfo
# Name    : texinfo-7.0.3,1
# Comment : Typeset documentation system with multiple format output
# Repo    : FreeBSD
# Filename: usr/local/bin/makeinfo
sudo pkg install texinfo

This means the project is actually using instead of CMake.

For example: open KRunner with Alt + Space, then type: debian: textwidgets. Your browser will open the "textwidgets" page of the automatically.

contact the developers
kdesrc-build
Meson
Debian Package Search website