Getting Started/Build/Troubleshooting: Difference between revisions

From KDE TechBase
m (Text replace - "<code>" to "<syntaxhighlight lang="text">")
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Template:I18n/Language Navigation Bar|Getting_Started/Build/Troubleshooting}}
 


{{TutorialBrowser|
{{TutorialBrowser|
Line 27: Line 27:
If you have a problem compiling a KDE program it error may not be in the most recent output, you need to first find the exact place where the error occured by scrolling back. If it is hard to find the error message in a long output, instead of using:
If you have a problem compiling a KDE program it error may not be in the most recent output, you need to first find the exact place where the error occured by scrolling back. If it is hard to find the error message in a long output, instead of using:


make -j''n''
{{Input|1=make -j''n''}}


use a simple  
use a simple  


make  
{{Input|1=make}}


to stop the compile output as soon as the first error message is found.
to stop the compile output as soon as the first error message is found.
Line 37: Line 37:
If you do not understand the error message, use  
If you do not understand the error message, use  


make VERBOSE=1
{{Input|1=make VERBOSE=1}}


to see the compile or link command that actually failed.
to see the compile or link command that actually failed.
Line 44: Line 44:


== Issues building kdelibs ==
== Issues building kdelibs ==
If you have problems compiling kdelibs, first make sure the software in the [[Getting_Started/Build/Requirements|Required Software]] section above is installed and works. If you install additional software, it may be necessary to remove {{path|~/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).
If you have problems compiling kdelibs, first make sure the software in the [[Getting_Started/Build/Requirements|Required Software]] section above is installed and works. If you install additional software, it may be necessary to remove {{path|~/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:
Other possible hints include:
* If the <tt>cmakekde</tt> command fails stating that CMake requires an out of source build directory, remove {{path|~/kde/src/KDE/kdelibs/CMakeCache.txt}}, and try again.
* If the <code>cmakekde</code> command fails stating that CMake requires an out of source build directory, remove {{path|~/kde/src/KDE/kdelibs/CMakeCache.txt}}, and try again. <br /><br />If <code>cmakekde</code> still gives the same error then try this {{Input|<syntaxhighlight lang="php" line>
 
  cd
If <tt>cmakekde</tt> still gives the same error then try this  
cd
  cmake -DCMAKE_INSTALL_PREFIX=$KDEDIR \
  cmake -DCMAKE_INSTALL_PREFIX=$KDEDIR \
  -DCMAKE_BUILD_TYPE=debugfull \
  -DCMAKE_BUILD_TYPE=debugfull \
Line 56: Line 55:
  ~/kde/src/KDE/kdelibs
  ~/kde/src/KDE/kdelibs
  make
  make
  make install
  make install</syntaxhighlight>}}
* 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 <tt>cs KDE/kdelibs && cb && cmakekde</tt>) If the message stays, run 'svn status' in the kdelibs directory and remove all files labeled with '?'.
 
* If you received an error stating ((Output|1=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 <code>cmakekde</code>. (e.g <code>cs KDE/kdelibs && cb && cmakekde</code>) If the message stays, run <code>svn status</code> in the kdelibs directory and remove all files labelled 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 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:
* 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: {{Input|1=update-alternatives --config qmake}}
update-alternatives --config qmake
* If the problems persist, try the CMake make-option <code>--keep-going</code>.
* If the problems persist, try the CMake make-option <tt>--keep-going</tt>.
* Here you need the ''libungif'' library, otherwise you will get an error message like {{Output|1=Could NOT find GIF}}.
* Here you need the libungif library, otherwise you will get an error message like "<tt>Could NOT find GIF</tt>".
* 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).
* 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 <syntaxhighlight lang="text">CMake Error: KDE Requires Qt to be built with SSL support
* if you get {{Output|1=CMake Error: KDE Requires Qt to be built with SSL support}}, install '''openssl-devel''', remove ''CMakeCache.txt'' and re-compile QT.
</code>, install openssl-devel, remove CMakeCache.txt and re-compile QT.
* if you get {{Output|1=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 you get <syntaxhighlight lang="text">kdelibs/kimgio/ico.cpp:188: undefined reference to `QImage::jumpTable()'</code> 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 <code>make clean</code> in kdelibs.
* if none of the errors above match yours, you might just try a quick'n'dirty <syntaxhighlight lang="text">make clean</code> in kdelibs.
* if you get {{Output|1=The PCRE regular expression library has not been found  >=4.5}} then watch out [[../Distributions/Debian|Recommended packages]] or {{Input|1=remove ../..  
* if you get "The PCRE regular expression library has not been found  >=4.5 " then watch out [[../Distributions/Debian|Recommended packages or  
build/kdelibs  
remove ../.. build/kdelibs  
cs KDE/kdelibs
cs KDE/kdelibs
cmakekde
cmakekde}}


* [stub] What to do if you have a problem like kde-config.cpp:56: undefined reference to `KLocalizedString::~KLocalizedString()' and  
* [stub] What to do if you have a problem like {{Output|1=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*)'}}?
/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
Seems to happen with some localization stuff


Line 81: Line 78:


== Issues building kdebase ==
== Issues building kdebase ==
If you have troubles compiling kdebase:
If you have troubles compiling kdebase:
* Due to a bug in building kdelibs, if you do not build your own copy of kdesupport/polkit-qt then you will get install errors in kdebase:
* Due to a bug in building kdelibs, if you do not build your own copy of kdesupport/polkit-qt then you will get install errors in kdebase:
<pre>
{{Output|1=
-- Installing: /usr/share/polkit-1/actions/org.kde.kcontrol.kcmremotewidgets.policy
-- Installing: /usr/share/polkit-1/actions/org.kde.kcontrol.kcmremotewidgets.policy
CMake Error at plasma/remotewidgetshelper/cmake_install.cmake:54 (FILE):
CMake Error at plasma/remotewidgetshelper/cmake_install.cmake:54 (FILE):
   file INSTALL cannot copy file
   file INSTALL cannot copy file
   "/home/kde-devel/kde/build/kde-runtime/plasma/remotewidgetshelper/org.kde.kcontrol.kcmremotewidgets.policy"
   "/home/kde-devel/kde/build/kde-runtime/plasma/remotewidgetshelper/org.kde.kcontrol.kcmremotewidgets.policy"
   to "/usr/share/polkit-1/actions/org.kde.kcontrol.kcmremotewidgets.policy".
   to "/usr/share/polkit-1/actions/org.kde.kcontrol.kcmremotewidgets.policy".}}
</pre>
To resolve this issue either install ''kdesupport/polkit-qt'' and rebuild kdelibs and kdebase (remember to remove the CMakeCache.txt), or pass an extra parm to cmake for -DKDE4_AUTH_POLICY_FILES_INSTALL_DIR=$KDEDIR/share/polkit-1/actions  
To resolve this issue either install kdesupport/polkit-qt and rebuild kdelibs and kdebase (remember to remove the CMakeCache.txt), or pass an extra parm to cmake for -DKDE4_AUTH_POLICY_FILES_INSTALL_DIR=$KDEDIR/share/polkit-1/actions  
* XINE is needed to compile kdebase-runtime
* XINE is needed to compile kdebase-runtime
* Make sure you have the <tt>libxss headers</tt> installed. (Usually you got undefined references on xscreensaver objects if you do not have those headers)
* Make sure you have the <code>libxss headers</code> installed. (Usually you got undefined references on xscreensaver objects if you do not have those headers)
* <tt>which meinproc4</tt> has to deliver {{path|/home/kde-devel/kde/bin/meinproc4}}
* <code>which meinproc4</code> has to deliver {{path|/home/kde-devel/kde/bin/meinproc4}}
* if cmakekde can not find the path of kdepimlibs, edit the file {{path|$KDE_BUILD/KDE/kdebase/CMakeCache.txt}} and manually set <tt>KDEPIMLIBS_INCLUDE_DIR:PATH=$KDE_BUILD/kdepimlibs</tt>
* if cmakekde can not find the path of kdepimlibs, edit the file {{path|$KDE_BUILD/KDE/kdebase/CMakeCache.txt}} and manually set <code>KDEPIMLIBS_INCLUDE_DIR:PATH=$KDE_BUILD/kdepimlibs</code>
* if you get an error saying "Please set the following variables: X11_XTest_LIB (ADVANCED)", install the devel package of <tt>Xtst</tt>. On some systems, this is packaged separately from <tt>xext</tt> and called <tt>x11proto-xext-dev</tt> or <tt>libxtst-dev</tt>. You may also need to remove the CMakeCache.txt file in the build dir after installing the package.
* if you get an error saying {{Output|1=Please set the following variables: X11_XTest_LIB (ADVANCED)}}, install the devel package of <code>Xtst</code>. On some systems, this is packaged separately from <tt>xext</tt> and called <tt>x11proto-xext-dev</tt> or <tt>libxtst-dev</tt>. 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 <tt>xinerama</tt>.
* the same for "X11_Xinerama_LIB (ADVANCED)" where you will need the devel package for <tt>xinerama</tt>.
* 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 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 {{Output|1=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 {{Output|1=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 (<tt>libxcomposite-dev</tt> in ubuntu)
* if you get the error {{Output|1=‘XserverRegion’ does not name a type}} make sure you have libxcomposite headers installed (<tt>libxcomposite-dev</tt> 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 the error {{Output|1=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: [http://www.plamadeala.com/files/macros_corrector.sh macros_corrector.sh]. It will just REMOVE the line that has "kde4_create_handbook" in it from all the found files.
* if you get messages as {{Output|1=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 <tt>~/kde/src/KDE/kdebase</tt>: [http://www.plamadeala.com/files/macros_corrector.sh 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 an error (in ubuntu) concerning libxtst.so install the <ttlibxtst-dev</tt> 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 the message {{Output|1=kdebase/workspace/kcontrol/kxkb/x11helper.cpp:131: error: ‘KGlobal’ has not been declared}}, you might need to install <tt>libxklavier</tt> 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 {{Output|1=/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 the issue {{Output|1=can't find REQUIRED package Blitz}}, install <tt>qimageblitz4</tt> and <tt>qimageblitz-dev</tt>
* If you get an error "class QWebFrame' has no member named 'contentsSize'" you need to upgrade your Qt
* If you get an error {{Output|1=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 have troubles building networkmanager-0.6, check if you have <tt>networkmanager-dev</tt> and <tt>libnm-util-dev</tt> installed
* If you get during cmake
* If you get during cmake {{Output|1= Please set the following variables:
Please set the following variables:
  CLUCENE_LIBRARY_DIR (ADVANCED)}}
  CLUCENE_LIBRARY_DIR (ADVANCED)
Make sure you have <tt>clucene</tt> installed and <tt>clucene-devel</tt>. 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 {{Input|1= cmake -DLIB_SUFFIX=64 }}.
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  
make sure it has been set by calling  
ccmake .
{{Input|1=ccmake}} .
* 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:
* 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:
CMAKE_LIBRARY_PATH=/home/kde-devel/kde/lib:$CMAKE_LIBRARY_PATH
{{Input|1=CMAKE_LIBRARY_PATH=/home/kde-devel/kde/lib:$CMAKE_LIBRARY_PATH
CMAKE_INCLUDE_PATH=/home/kde-devel/kde/include:$CMAKE_INCLUDE_PATH
CMAKE_INCLUDE_PATH=/home/kde-devel/kde/include:$CMAKE_INCLUDE_PATH}}
 
and delete the CMakeCache.txt in your build directory.
and delete the CMakeCache.txt in your build directory.


* If you get such error:  
* If you get such error:  
CMake Error at workspace/plasma/scriptengines/python/cmake_install.cmake:68
{{Output|1=CMake Error at workspace/plasma/scriptengines/python/cmake_install.cmake:68
(FILE):
(FILE):
   file INSTALL cannot copy file
   file INSTALL cannot copy file
Line 135: Line 129:
   workspace/cmake_install.cmake:62 (INCLUDE)
   workspace/cmake_install.cmake:62 (INCLUDE)
   cmake_install.cmake:39 (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)
try to set: <code>-DPYTHON_SITE_PACKAGES_INSTALL_DIR=~/.local/lib/python2.6/site-packages</code> (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)
as a parameter for cmake (or cmakekde)


Line 142: Line 137:
*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.
*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 ).
*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 <code>export CMAKE_PREFIX_PATH=$KDEDIR</code>. Be sure that it is added after the declaration of $KDEDIR (something I had overlooked :D ).


== Issues building kdepimlibs ==
== Issues building kdepimlibs ==
If you have trouble compiling 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.
* 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.
* if cmake complains about missing akonadi headers, <tt>CMake Error: Could not find Akonadi includes</tt>. 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 ===
=== The Recipe for Automoc ===
{{Input|<syntaxhighlight lang="php" line>
  cd
  cd
  cs
  cs
  mkdir kdesupport && cd kdesupport
  mkdir kdesupport && cd kdesupport
  svn checkout svn://anonsvn.kde.org/home/kde/trunk/kdesupport/automoc
  git clone git://anongit.kde.org/automoc
  cd automoc
  cd automoc
  cmakekde
  cmakekde</syntaxhighlight>}}


=== The Recipe for Akonadi ===
=== The Recipe for Akonadi ===
{{Input|<syntaxhighlight lang="php" line>
  cd
  cd
  cs
  cs
  cd kdesupport
  cd kdesupport
  svn checkout svn://anonsvn.kde.org/home/kde/trunk/kdesupport/akonadi
  git clone git://anongit.kde.org/akonadi
  cd akonadi
  cd akonadi
  cmakekde
  cmakekde</syntaxhighlight>}}


== Issues building kdebindings ==
== Issues building kdebindings ==
Line 169: Line 169:
=== Installing python bindings ===
=== 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:
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: {{Input|1= KDE_DEVEL_USER=kde-devel
 
KDE_DEVEL_USER=kde-devel
  mkdir -p /usr/share/sip/PyKDE4
  mkdir -p /usr/share/sip/PyKDE4
  for dir in  /usr/lib/python*; do
  for dir in  /usr/lib/python*; do
Line 177: Line 175:
  done
  done
  chown $KDE_DEVEL_USER /usr/share/sip/PyKDE4 \
  chown $KDE_DEVEL_USER /usr/share/sip/PyKDE4 \
                       /usr/lib/python*/site-packages/PyKDE4
                       /usr/lib/python*/site-packages/PyKDE4}}
 


Note: You may need to change /usr/lib to /usr/lib64
Note: You may need to change /usr/lib to /usr/lib64
Line 188: Line 185:
== Running programs ==
== Running programs ==


* If you get  
* If you get {{Output|1=KUniqueApplication: Cannot find the D-Bus session server
KUniqueApplication: Cannot find the D-Bus session server
make sure you can access the display, e.g. type <code> xclock</code>
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 <code> dbus-launch xterm</code>
xclock
then a clock must appear on the screen. If it does and the error persists, start your shell using
dbus-launch xterm
and start your program in there.
and start your program in there.


* If you get something like
* If you get something like {{Output|1= Error: standard icon theme "oxygen" not found!
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
  ASSERT: "!isEmpty()" in file /home/kde-devel/qt-copy/include/QtCore/../../src/corelib/tools/qlist.h, line 245
  Aborted (core dumped)
  Aborted (core dumped)}}
You need to install kdebase - see above. It is enough to install the "runtime" directory from kdebase.
You need to install <tt>kdebase</tt> - see above. It is enough to install the "runtime" directory from kdebase.


== General troubleshooting ==
== General troubleshooting ==


What can happen over time, after some <tt>svn up</tt> commands, is that some of the tools used in the KDE build chain change their output format. For example, <tt>kcfg</tt> files are read by <tt>kconfig_compiler</tt> 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:
What can happen over time, after some <tt>svn up</tt> commands, is that some of the tools used in the KDE build chain change their output format. For example, <tt>kcfg</tt> files are read by <tt>kconfig_compiler</tt> 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: {{Input|1= find $KDE_SRC/KDE/kdebase -name "*.kcfg" | xargs touch}}
find $KDE_SRC/KDE/kdebase -name "*.kcfg" | xargs touch
The same applies to <tt>ui</tt> files as produced by Qt designer.
The same applies to <tt>ui</tt> files as produced by Qt designer.


=== Locked sessions ===
=== Locked sessions ===
When installing KDE 4 as a user, one may be not able to unlock a locked session, depending on the system configuration.
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:
If the problem are insufficient permissions of the kcheckpass binary, the fix is to run this: {{Input|<syntaxhighlight lang="php" line>
<syntaxhighlight lang="text">  
chown root.root $KDEDIR/lib/kde4/libexec/kcheckpass
chown root.root $KDEDIR/lib/kde4/libexec/kcheckpass
chmod 4755 $KDEDIR/lib/kde4/libexec/kcheckpass
chmod 4755 $KDEDIR/lib/kde4/libexec/kcheckpass
</code>  
</syntaxhighlight> }}


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.
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:
For example for RH/Fedora based distros: {{Input|<syntaxhighlight lang="php" line>
<syntaxhighlight lang="text">  
#%PAM-1.0
#%PAM-1.0
auth      include      system-auth
auth      include      system-auth
Line 227: Line 218:
password  include      system-auth
password  include      system-auth
session    include      system-auth
session    include      system-auth
</code>
</syntaxhighlight>}}


while for debian/Kubuntu:
while for debian/Kubuntu:
<syntaxhighlight lang="text">  
{{Input|<syntaxhighlight lang="php" line>
# Standard Un*x authentication.
# Standard Un*x authentication.
@include common-auth
@include common-auth
Line 236: Line 227:
@include common-session
@include common-session
@include common-password
@include common-password
</code>
</syntaxhighlight>}}


==Some other common problems==
==Some other common problems==


===Can't find X includes===
===Can't find X includes===
X headers like '''X.h''' are missing. They usually reside in '''/usr/include/X11/''' or similar. Your distribution may contain them in a seperate package like '''X-devel'''. If the files are simply installed in a non-standard directory see '''configure --help'''.
X headers like '''X.h''' are missing. They usually reside in '''/usr/include/X11/''' or similar. Your distribution may contain them in a seperate package like '''X-devel'''. If the files are simply installed in a non-standard directory see '''configure --help'''.


===cannot find -lXext===
===cannot find -lXext===
When using SuSE, install xdevel from SuSE's "X" Series in YaST. On Caldera, Mandrake and Redhat the package is named XFree86-devel.
When using SuSE, install xdevel from SuSE's "X" Series in YaST. On Caldera, Mandrake and Redhat the package is named XFree86-devel.


===configure in kdesupport gives: Header string not found===
===configure in kdesupport gives: Header string not found===
Install libstdc++-devel.
Install libstdc++-devel.


===Qt [....] not found.===
===Qt [....] not found.===
Do you have the currently required Qt library installed ? See "How to get the latest sources". Make sure that QTDIR is pointing to the correct location.
Do you have the currently required Qt library installed ? See "How to get the latest sources". Make sure that QTDIR is pointing to the correct location.


=== Solaris ===


=== Solaris ===
If you are using Solaris 2.6 and want to compile KDE as a normal user, please see [http://developer.kde.org/build/solariscompile.html this document] first.
If you are using Solaris 2.6 and want to compile KDE as a normal user, please see [http://developer.kde.org/build/solariscompile.html this document] first.


===(Solaris) ANSI C++ forbids declaration `XSetTransientForHint' with no type===
===(Solaris) ANSI C++ forbids declaration `XSetTransientForHint' with no type===
Well it's not new but better put it somewhere. Solaris X headers are buggy. They declare functions with no return type (assuming it defaults to int). You can get around by setting '''CXXFLAGS="-fpermissive"''' before '''./configure''' to let g++ be okay with that.
 
Well it's not new but better put it somewhere. Solaris X headers are buggy. They declare functions with no return type (assuming it defaults to int). You can get around by setting <code>CXXFLAGS="-fpermissive"</code> before <code>./configure</code> to let g++ be okay with that.


===(BSD) Shared libraries are not correctly built, konqueror crashes with "Undefined symbol __eh_rtime_match"===
===(BSD) Shared libraries are not correctly built, konqueror crashes with "Undefined symbol __eh_rtime_match"===
Set '''LIBS="-lgcc -lstdc++ -Wl,-export-dynamic"''' while running configure, for all modules.
 
Set <code>LIBS="-lgcc -lstdc++ -Wl,-export-dynamic"</code> while running configure, for all modules.


=== 'Gslice' crash messages after KDE has been built with --enable-fast-malloc=full ===
=== 'Gslice' crash messages after KDE has been built with --enable-fast-malloc=full ===
If you are using a recent version of Glib (version >= 2.9.1) and have built kdelibs using the configure option '''--enable-fast-malloc=full''', you are likely to see aRts related crashes which output an error message on the terminal:
 
If you are using a recent version of Glib (version >= 2.9.1) and have built kdelibs using the configure option <code>--enable-fast-malloc=full</code>, you are likely to see aRts related crashes which output an error message on the terminal:


  ***MEMORY-ERROR***: [xxxx]: GSlice: failed to allocate 248 bytes (alignment: 256): Invalid argument
  ***MEMORY-ERROR***: [xxxx]: GSlice: failed to allocate 248 bytes (alignment: 256): Invalid argument


This is due to a clash in the way that arts/kdelibs and Glib handle memory allocation. There are two alternative solutions to this: one is to not use --'''enable-fast-malloc=full'''; the other is to set an environment variable for the KDE session
This is due to a clash in the way that arts/kdelibs and Glib handle memory allocation. There are two alternative solutions to this: one is to not use --'''enable-fast-malloc=full'''; the other is to set an environment variable for the KDE session ((Input|1= G_SLICE=always-malloc}}
 
G_SLICE=always-malloc

Latest revision as of 20:55, 10 March 2016


Building KDE4 From Source/Troubleshooting
Tutorial Series   Getting Started
Previous   Build KDE
What's Next   Build KDE
Further Reading   n/a

NOTE: This information should mostly be moved to the pages describing how to build the packages for easier reference. Only generic solutions, or solutions that are take too much space should live here.

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.

Methodology

You can hit problems building KDE in any of the build steps.

When configuring KDE using CMake you may see messages about missing requirements that you need to fix. Fix the missing requirements then try configure again. You may sometimes need to delete the CMakeCache.txt file in the build directory.

If you have a problem compiling a KDE program it error may not be in the most recent output, you need to first find the exact place where the error occured by scrolling back. If it is hard to find the error message in a long output, instead of using:

make -jn

use a simple

make

to stop the compile output as soon as the first error message is found.

If you do not understand the error message, use

make VERBOSE=1

to see the compile or link command that actually failed.

When using the kdesrc-build script you can view the kdesrc-build log files to find the build output.

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 ((Output|1=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 labelled 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 clean in kdelibs.
  • if you get
    The PCRE regular expression library has not been found  >=4.5
    then watch out 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:

  • Due to a bug in building kdelibs, if you do not build your own copy of kdesupport/polkit-qt then you will get install errors in kdebase:
-- Installing: /usr/share/polkit-1/actions/org.kde.kcontrol.kcmremotewidgets.policy
CMake Error at plasma/remotewidgetshelper/cmake_install.cmake:54 (FILE):
  file INSTALL cannot copy file
  "/home/kde-devel/kde/build/kde-runtime/plasma/remotewidgetshelper/org.kde.kcontrol.kcmremotewidgets.policy"
  to "/usr/share/polkit-1/actions/org.kde.kcontrol.kcmremotewidgets.policy".

To resolve this issue either install kdesupport/polkit-qt and rebuild kdelibs and kdebase (remember to remove the CMakeCache.txt), or pass an extra parm to cmake for -DKDE4_AUTH_POLICY_FILES_INSTALL_DIR=$KDEDIR/share/polkit-1/actions

  • 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 <ttlibxtst-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

ccmake

.

  • 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:
CMAKE_LIBRARY_PATH=/home/kde-devel/kde/lib:$CMAKE_LIBRARY_PATH
CMAKE_INCLUDE_PATH=/home/kde-devel/kde/include:$CMAKE_INCLUDE_PATH

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
 
"[...]/kde/source/kdebase/workspace/plasma/scriptengines/python/plasmascript.py"
  to "/usr/lib/python2.6/site-packages/PyKDE4/plasmascript.py".
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_INSTALL_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
 git clone git://anongit.kde.org/automoc
 cd automoc
 cmakekde

The Recipe for Akonadi

 cd
 cs
 cd kdesupport
 git clone git://anongit.kde.org/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.

Running programs

  • If you get
    G_SLICE=always-malloc