This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Compiling kde-baseapps with MSVC 2013 (as a novice)

Tags: None
(comma "," separated)
salve.nauta
Registered Member
Posts
4
Karma
0
Hi, I recently worked through getting kde-baseapps to compile on Windows 7 as a newcomer (x86, RelWithDebInfo and Debug versions). Given recent questions (https://forum.kde.org/viewtopic.php?f=154&t=124756), hopefully this will be a useful resource for others who would like to get kde-baseapps compiling from a recent revision in the git repository (I worked with files pulled on 1/29/2015, last commit 45abedddf18d1c4eb48f3ba8a7df2d963ba28b3c). I am not a KDE developer and the below is ad hoc, but I did get everything to compile and did get dolphin to run and work (my main goal).

Some general issues I encountered could be solved simply be re-running the emerge command I had run (e.g. sometimes files wouldn't be downloaded/pulled from the repository). The CMakeOutput.log files can be quite helpful - these are typically found under r:\build if the drive letters in kdesettings.ini are left as in the repository.

The starting point is https://techbase.kde.org/Getting_Started/Build/Windows/emerge. Below are work-arounds and additional things I had to do to get all the way through the steps given in that document. In general, I'm listing an error I encountered in italics and then a solution below. If anyone follows what I've outlined and has an issue or finds anything I have omitted, please reply and let me know. I will work further on this code soon. Of course I'd welcome suggestions that would improve on my temporary hacks and other comments from experienced developers.

  1. Changes to kdesettings.ini:
    Code: Select all
    13c13
    < KDECOMPILER = mingw4
    ---
    > KDECOMPILER = msvc2013
    51c51
    < #EMERGE_BUILDTYPE = Debug
    ---
    > EMERGE_BUILDTYPE = Debug
    90c90
    < Path = D:\Qt
    ---
    > Path = C:\Qt
    96c96,97
    < Compiler = mingw482_32
    ---
    > Compiler = msvc2013
    > ##mingw482_32
    120c121
    < PACKAGE_IGNORES =
    ---
    > PACKAGE_IGNORES = binary/mysql-pkg

  2. emerge qt
    1. Q:\qtwebkit\Source\WTF\wtf/Platform.h(703) : fatal error C1083: Cannot open include file: 'WTF/WTFHeaderDetection.h': No such file or directory

      Re-run "emerge qt".


  3. emerge frameworks
    1. CMake Error at r:/lib/cmake/Qt5/Qt5Config.cmake:26 (find_package): Could not find a package configuration file provided by "Qt5WebKitWidgets"

      Run "emerge -i qtwebkit". See: https://forum.kde.org/viewtopic.php?f=67&t=119453 for more info.

    2. q:\plasma-framework\src\plasma\private/framesvg_helpers.h(47) : error C2051: case expression not constant

      MSVC bug, replace switch/case with if/else as given in https://git.reviewboard.kde.org/r/120877/diff/2/#0. Andrius da Costa Ribas provided a number of patches I used.


  4. emerge kde-baseapps
    1. CMake Error: File r:/lib/cmake/KF5KDELibs4Support/../KF5Init/kde5init_win32lib_dummy.cpp.in does not exist.

      Replace kde4_add_kdeinit_executable with kf5_add_kdeinit_executable in all CMakeLists.txt files (keditbookmarks, konqueror). This was following example of a porting script: plasma/src/tools/port-cmake.sh: perl -p -i -e 's/kde4_add_kdeinit_executable/kf5_add_kdeinit_executable/g' $FS.

    2. file:///R:/share/kf5/kdoctools/customization/dtd/kdex.dtd:115: warning: failed to load external entity "file:///dtd/modifications.elements"

      Warning: ugly "fix" in the build directory, likely easy enough to fix in source.
      Fix incomplete paths in: build/frameworks/kdelibs4support/work/msvc2013-Debug-master/src/customization/dtd/kdex.dtd. For example, fix % kde.modifications ENTITY to have a path like "r://share/kf5/kdoctools/customization/dtd/modifications.elements".

    3. r:\include\QtCore/qhash.h(102) : error C2665: 'qHash' : none of the 24 overloads could convert all the argument types

      Patch here: https://git.reviewboard.kde.org/r/121080/diff/

    4. q:\kde-baseapps\lib\konq\src\konq_copytomenu.cpp(127) : error C3861: 'QT_WA': identifier not found

      Patch here: https://git.reviewboard.kde.org/r/121081/diff/

    5. q:\kde-baseapps\konqueror\client\kfmclient.h(23) : fatal error C1083: Cannot open include file: 'kglobal.h': No such file or directory

      Patch download/git/kde-baseapps/konqueror/client/CMakeLists.txt (add KF5::KDELibs4Support).
      Code: Select all
      <     target_link_libraries(kfmclient  KF5::KIOCore )
            ---
      >     target_link_libraries(kfmclient  KF5::KIOCore KF5::KDELibs4Support)


    6. q:\kde-baseapps\konq-plugins\webarchiver\archivedialog.cpp(498) : error C2248: 'ArchiveDialog::URL2Part' : cannot access private typedef declared in class 'ArchiveDialog'

      In archivedialog.h, I simply moved Name2Part and URL2Part to the public part of the class.

    7. q:\kde-baseapps\konq-plugins\fsview\scan.cpp(271) : error C3861: 'QT_LSTAT': identifier not found

      There is a KDE-rolled lstat replacement for Windows, see https://projects.kde.org/projects/frameworks/kio/repository/revisions/79901961acd014d239dafe33569cdd57446bb71d/diff. Perhaps this code could be referenced? I simply defined QT_LSTAT as QT_STAT in konq-plugins/fsview/scan.cpp - this will fail at runtime in some cases (symbolic links).

    8. kfileitemmodel.cpp.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const KFileItemModelDirLister::staticMetaObject" (?staticMetaObject@KFileItemModelDirLister@@2UQMetaObject@@B)

      See: https://git.reviewboard.kde.org/r/121079/diff/#

  5. Runtime
    1. Could not start process Unable to create io-slave: klauncher said: Could not find the "kf5/kio/file' plugin.

      The Qt plugin finder is being used. Paths used can be modified by setting environment variables which is what I did before running kdeinit5. Specifically:

      set QT_PLUGIN_PATH=r:\lib\plugins
      kdeinit5
notears
Registered Member
Posts
3
Karma
0
Thank you very much for this. I shall do my best to offer any additional insight (should i find it)


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]