Languages: عربي | Asturianu | Català | Česky | Kaszëbsczi | Dansk | Deutsch | English | Esperanto | Español | Eesti | فارسی | Suomi | Français | Galego | Italiano | 日本語 | 한국어 | Norwegian | Polski | Português Brasileiro | Română | Русский | Svenska | Slovenčina | Slovenščina | српски | Türkçe | Tiếng Việt | Українська | 简体中文 | 繁體中文
This page contains some troubleshooting tips for issues you may encounter while building kde4 from source.
Many of the issues listed here may be out of date.
If you have a problem building a KDE program, first find the exact place where it occurs. Instead of using
use a simple
to see the error message. If you do not understand the error message, use
to see the compile or link command that actually failed.
Also, when using kdesrc-build view the log files.
You may have to troubleshoot qt building too..
- error in about phonon --
Issues building kdelibs
If you have problems compiling kdelibs, first make sure the software in the Required Software section above is installed and works. If you install additional software, it may be necessary to remove ~/kde/src/KDE/kdelibs/CMakeCache.txt before trying the build again. In particular, pay attention to the requirement of kdesupport (such as the components for automoc, strigi, phonon, etc).
Other possible hints include:
- If the cmakekde command fails stating that CMake requires an out of source build directory, remove ~/kde/src/KDE/kdelibs/CMakeCache.txt, and try again.
If cmakekde still gives the same error then try this
cd cmake -DCMAKE_INSTALL_PREFIX=$KDEDIR \ -DCMAKE_BUILD_TYPE=debugfull \ -DKDE4_BUILD_TESTS=ON \ ~/kde/src/KDE/kdelibs make make install
- If you received an error stating "Please create a separate build directory and run 'cmake path_to_kdelibs [options]' there.", then you need to change to your build directory before running cmakekde. (e.g cs KDE/kdelibs && cb && cmakekde) If the message stays, run 'svn status' in the kdelibs directory and remove all files labeled with '?'.
- If Qt wasn't found or the wrong version of Qt was found, make sure that the qmake from the Qt you need is the first qmake in the path.
- If qmake wasn't found and you are using Debian packages, /usr/bin/qmake probably points to a wrong qmake version. To fix this run as root:
update-alternatives --config qmake
- If the problems persist, try the CMake make-option --keep-going.
- Here you need the libungif library, otherwise you will get an error message like "Could NOT find GIF".
- Qt-4.3 upgrade: if you get a link error in kjsembed talking about QScriptEngine, edit CMakeCache.txt in kdelibs and remove the lines that talk about QT_QTUITOOLS_LIBRARY, then type make again (that static library has a new dependency, and the cmake code that adds it needs to run).
- if you get
CMake Error: KDE Requires Qt to be built with SSL support
, install openssl-devel, remove CMakeCache.txt and re-compile QT.
- if you get
kdelibs/kimgio/ico.cpp:188: undefined reference to `QImage::jumpTable()'it means you compiled Qt without Qt3 support(no, linking to a true Qt3 install won't work)
- if none of the errors above match yours, you might just try a quick'n'dirty
make cleanin kdelibs.
- if you get "The PCRE regular expression library has not been found >=4.5 " then watch out the http://techbase.kde.org/index.php?title=Getting_Started/Build/KDE4/Kubuntu_and_Debian (Getting Started/Build/KDE4/Kubuntu and Debian-> kdelibs dependancies ->Recommended packages ) or
remove ../.. build/kdelibs cs KDE/kdelibs cmakekde
- [stub] What to do if you have a problem like kde-config.cpp:56: undefined reference to `KLocalizedString::~KLocalizedString()' and
/Depot/Temp/kdelibs-4.0.2/kdecore/kde-config.cpp:197: undefined reference to `KConfigGroup::readPathEntry(char const*, QString const&) const' and kde-config.cpp:66: undefined reference to `ki18n(char const*)'? Seems to happen with some localization stuff
Issues building kdebase
If you have troubles compiling kdebase:
- XINE is needed to compile kdebase-runtime
- Make sure you have the libxss headers installed. (Usually you got undefined references on xscreensaver objects if you do not have those headers)
- which meinproc4 has to deliver /home/kde-devel/kde/bin/meinproc4
- if cmakekde can not find the path of kdepimlibs, edit the file $KDE_BUILD/KDE/kdebase/CMakeCache.txt and manually set KDEPIMLIBS_INCLUDE_DIR:PATH=$KDE_BUILD/kdepimlibs
- if you get an error saying "Please set the following variables: X11_XTest_LIB (ADVANCED)", install the devel package of Xtst. On some systems, this is packaged separately from xext and called x11proto-xext-dev or libxtst-dev. You may also need to remove the CMakeCache.txt file in the build dir after installing the package.
- the same for "X11_Xinerama_LIB (ADVANCED)" where you will need the devel package for xinerama.
- if you get an error complaining about a missing variable X11_Xrandr_LIB, you need the devel package for libxrandr (libxrandr-devel on ubuntu-systems)
- if you get the error "Please set the following variables: FONTCONFIG_INCLUDE_DIR, FONTCONFIG_LIBRARIES (ADVANCED)", then you need to install the libfontconfig headers
- if you get the error "CMake Error: This project requires some variables to be set, and cmake can not find them. Please set the following variables: KMETADATA_LIBRARIES", you need to install soprano from kdesupport and to rebuild kdelibs
- if you get the error "‘XserverRegion’ does not name a type" make sure you have libxcomposite headers installed (libxcomposite-dev in ubuntu)
- if you get the error "CMake Error: This project requires some variables to be set, and cmake can not find them. Please set the following variables: QT_QTOPENGL_LIBRARY (ADVANCED) ", try editing CMakeCache.txt and setting QT_QTOPENGL_LIBRARY:FILEPATH=/home/kde-devel/qt-copy/lib/libQtOpenGL.so
- if you get messages as "KDE4_INSTALL_HANDBOOK() is deprecated. Remove it please. Now all is done in KDE4_CREATE_HANDBOOK." then, either find the files containing the offending line and comment it out manually, or run the following script in ~/kde/src/KDE/kdebase: macros_corrector.sh. It will just REMOVE the line that has "kde4_create_handbook" in it from all the found files.
- If you get an error (in ubuntu) concerning libxtst.so install the libxtst-dev package
- If you get the message "kdebase/workspace/kcontrol/kxkb/x11helper.cpp:131: error: ‘KGlobal’ has not been declared", you might need to install libxklavier development packages.
- If you get "/home/kde-devel/kde/lib/libkio.so: undefined reference to `Strigi::AnalysisResult::AnalysisResult(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, Strigi::IndexWriter&, Strigi::StreamAnalyzer&)'" you probably have an outdated version of strigi installed by your distro. By the way, after update the strigi, you must recompile kdelibs for a new libkio.so.
- If you get the issue "can't find REQUIRED package Blitz", install qimageblitz4 and qimageblitz-dev
- If you get an error "class QWebFrame' has no member named 'contentsSize'" you need to upgrade your Qt
- If you have troubles building networkmanager-0.6, check if you have networkmanager-dev and libnm-util-dev installed
- If you get during cmake
Please set the following variables: CLUCENE_LIBRARY_DIR (ADVANCED)
Make sure you have clucene installed and clucene-devel. If necessary, get the source from sourceforge and compile it. If you have SUSE and an x64 installation, you need to make cmake aware your library path is /usr/lib64, not /usr/lib. Do this with
cmake -DLIB_SUFFIX=64 .
make sure it has been set by calling
- If you get an error saying your soprano libraries are too old, but you've installed them under kdesupport, check to see if your build is using your system libraries instead. If so, then set:
and delete the CMakeCache.txt in your build directory.
- If you get such error:
CMake Error at workspace/plasma/scriptengines/python/cmake_install.cmake:68 (FILE):
file INSTALL cannot copy file
Call Stack (most recent call first):
workspace/plasma/scriptengines/cmake_install.cmake:40 (INCLUDE) workspace/plasma/cmake_install.cmake:43 (INCLUDE) workspace/cmake_install.cmake:62 (INCLUDE) cmake_install.cmake:39 (INCLUDE)
try to set: -DPYTHON_SITE_PACKAGES_DIR=~/.local/lib/python2.6/site-packages (check that this path corresponds to something in your system, you might have a different version of python) as a parameter for cmake (or cmakekde)
- After any error you get, be sure to delete CMakeCache.txt, so that it forces cmake to reprocess it, instead of just reading the file and not seeing changes.
- If you encounter an error somewhere along the lines of using an older version of automoc 4, and thus not being able to compile. Since this is included in kdesupport, be sure you have this built. If it still does not work after this, open your ~/.bashrc file and add the line 'export CMAKE_PREFIX_PATH=$KDEDIR'. Be sure that it is added after the declaration of $KDEDIR (something I had overlooked :D ).
Issues building kdepimlibs
If you have trouble compiling kdepimlibs:
- the cmakekde command may require a later version of the gpgme library. This is available from the project's web site: http://www.gnupg.org/download/index.html - please note that the build of gpgme also requires libgpg-error, also available from the same location. Both libraries are installed by the "./configure", "make" and "sudo make install" sequence, with the gpgme library configured with the additional "--with-gpg-error-prefix" parameter. You may need to overwrite your existing "/usr/bin/gpgme-config" file with the newer version for the kdepimlibs to pick up the new install.
- if cmake complains about missing akonadi headers, (CMake Error: Could not find Akonadi includes. or something similiar), then you lack the akonadi package which can be found in the kdesupport module. Since the kdesupport as a whole is quite large it is recommended that you selectively download the packages you need instead of fetching the entire kdesupport module.Akonadi relies on automoc, so we have to install it prior to building akonadi. The Automoc module can also be found in kdesupport.
The Recipe for Automoc
cd cs mkdir kdesupport && cd kdesupport svn checkout svn://anonsvn.kde.org/home/kde/trunk/kdesupport/automoc cd automoc cmakekde
The Recipe for Akonadi
cd cs cd kdesupport svn checkout svn://anonsvn.kde.org/home/kde/trunk/kdesupport/akonadi cd akonadi cmakekde
Issues building kdebindings
Installing python bindings
If you are building and installing packages as a dedicated user, you may find that the installation of the python bindings fails because it can't install the necessary files in some system-wide directories. To resolve this, execute the following code as root:
KDE_DEVEL_USER=kde-devel mkdir -p /usr/share/sip/PyKDE4 for dir in /usr/lib/python*; do mkdir -p $dir/site-packages/PyKDE4 done chown $KDE_DEVEL_USER /usr/share/sip/PyKDE4 \ /usr/lib/python*/site-packages/PyKDE4
Note: You may need to change /usr/lib to /usr/lib64
Note: I had to use "dist-packages" instead of "site-packages" in the above
This will allow your development user to install the files it needs to, without giving it unnecessary access to your system.
- If you get
KUniqueApplication: Cannot find the D-Bus session server
make sure you can access the display, e.g. type
then a clock must appear on the screen. If it does and the error persists, start your shell using
and start your program in there.
- If you get something like
Error: standard icon theme "oxygen" not found! ASSERT: "!isEmpty()" in file /home/kde-devel/qt-copy/include/QtCore/../../src/corelib/tools/qlist.h, line 245 Aborted (core dumped)
You need to install kdebase - see above. It is enough to install the "runtime" directory from kdebase.
What can happen over time, after some svn up commands, is that some of the tools used in the KDE build chain change their output format. For example, kcfg files are read by kconfig_compiler to produce configuration dialogs. CMake cannot detect those changes, and the compilation might fail. A workaround is to always force a re-generation of all such files:
find $KDE_SRC/KDE/kdebase -name "*.kcfg" | xargs touch
The same applies to ui files as produced by Qt designer.
When installing KDE 4 as a user, one may be not able to unlock a locked session, depending on the system configuration.
If the problem are insufficient permissions of the kcheckpass binary, the fix is to run this:
chown root.root $KDEDIR/lib/kde4/libexec/kcheckpass
chmod 4755 $KDEDIR/lib/kde4/libexec/kcheckpass
Alternatively, if KDE is built with PAM (libpam-dev is installed while configuring kdebase), the problem may be a missing PAM service definition ("kde" by default) in the /etc/pam.d/ folder. The simplest fix is running "make install" in kdebase/workspace/ as root. Alternatively, one can copy the "login" service and possibly adjust it.
For example for RH/Fedora based distros:
auth include system-auth
account include system-auth
password include system-auth
session include system-auth
while for debian/Kubuntu:
- Standard Un*x authentication.