[Okular-devel] Building on Windows

Jonathan Schultz jonathan at imatix.com
Mon Mar 7 04:54:03 UTC 2016


Hello all,

On trying, and eventually succeeding in building Okular version 1.0.0 
under KF 5.5.0 and Windows 7, I found a few points (with the help of 
Thomas Friedrichsmeier on the kde-windows list) that probably need 
attention. Starting with the simplest and least difficult:

1. Line 14 of interfaces/viewerinterface.h refers to the _MSC_VER - this 
should be Q_OS_WIN

2. A whole bunch of symbols from /mobile/components/settings.cpp were 
missing when building libokularplugin.dll. This could be resolved by the 
following patch:

diff --git a/mobile/components/CMakeLists.txt
b/mobile/components/CMakeLists.txt index e09326a..d3ba32f 100644
--- a/mobile/components/CMakeLists.txt
+++ b/mobile/components/CMakeLists.txt
@@ -30,6 +30,7 @@ target_link_libraries(okularplugin
          Qt5::Xml
          Qt5::Svg
          okularcore
+        okularpart
          KF5::KDELibs4Support
          )

The only problem was that the symbols were then multiply defined. So I 
then applied the following:

--- a/conf/settings.kcfgc
+++ b/conf/settings.kcfgc
@@ -4,7 +4,7 @@
  Inherits=SettingsCore
  Mutators=true
  Singleton=true
-Visibility=OKULARPART_EXPORT
+#Visibility=OKULARPART_EXPORT
  IncludeFiles=settings_core.h,okularpart_export.h
  SourceIncludeFiles=qdom.h,QStandardPaths
  MemberVariables=dpointer

I admit that I don't have much idea whether these are correct solutions 
or just things that happen to work.

3. For some reason that I have no idea of, the build process (I'm using 
emerge) produces a dynamic library called libokularpart.dll, but the 
executable tries to find a library called okularpart.dll. Simply 
renaming the built library works as a work-around.

With those changes, the code now builds and executes. There is then a 
problem opening a file, as the executable crashes on loading the open 
file dialog. If you provide a filename as an argument to the executable 
then it loads that file correctly. I haven't had a chance to look at 
this problem yet, but will do in due course.

I mainly wanted to flag these problems with the build process and leave 
further issues for a later post.

Best,
Jonathan



More information about the Okular-devel mailing list