[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [krita] libs: Fix build error on windows
From:       Boudewijn Rempt <null () kde ! org>
Date:       2018-06-30 12:30:48
Message-ID: E1fZF1c-0006tN-UG () code ! kde ! org
[Download RAW message or body]

Git commit eb030aa161580d145319b8ecfc2916bf64bb6b06 by Boudewijn Rempt.
Committed on 30/06/2018 at 12:10.
Pushed by rempt into branch 'master'.

Fix build error on windows

I'm not totally sure what's up, but the double declaration doesn;t work:

canning dependencies of target kritaui
[ 55%] Building CXX object
libs/ui/CMakeFiles/kritaui.dir/widgets/KisScreenColorPicker.cpp.obj
C:\dev\krita\libs\ui\widgets\KisScreenColorPicker.cpp:275:83: warning:
'KisDlgInternalColorSelector::s_screenColorPickerFactory' redeclared
without dllimport attribute: previous dllimport ignored [-Wattributes]
 std::function<KisScreenColorPickerBase *(QWidget *)>
KisDlgInternalColorSelector::s_screenColorPickerFactory =
KisScreenColorPicker::createScreenColorPicker;
                                                                                   \
^~~~~~~~~~~~~~~~~~~~~~~~~~ C:\dev\krita\libs\ui\widgets\KisScreenColorPicker.cpp: In \
function 'void __tcf_3()':
C:\dev\krita\libs\ui\widgets\KisScreenColorPicker.cpp:275:54: error:
definition of static data member
'KisDlgInternalColorSelector::s_screenColorPickerFactory' of dllimport'd
class
 std::function<KisScreenColorPickerBase *(QWidget *)>
KisDlgInternalColorSelector::s_screenColorPickerFactory =
KisScreenColorPicker::createScreenColorPicker;
                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
libs\ui\CMakeFiles\kritaui.dir\build.make:6050: recipe for target
'libs/ui/CMakeFiles/kritaui.dir/widgets/KisScreenColorPicker.cpp.obj'
failed
mingw32-make[2]: ***
[libs/ui/CMakeFiles/kritaui.dir/widgets/KisScreenColorPicker.cpp.obj]
Error 1
CMakeFiles\Makefile2:18278: recipe for target
'libs/ui/CMakeFiles/kritaui.dir/all' failed
mingw32-make[1]: *** [libs/ui/CMakeFiles/kritaui.dir/all] Error 2
Makefile:139: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

M  +6    -0    libs/ui/KisApplication.cpp
M  +0    -3    libs/ui/widgets/KisScreenColorPicker.cpp
M  +4    -2    libs/widgets/KisDlgInternalColorSelector.h

https://commits.kde.org/krita/eb030aa161580d145319b8ecfc2916bf64bb6b06

diff --git a/libs/ui/KisApplication.cpp b/libs/ui/KisApplication.cpp
index aaea1acf514..2dfc9e13666 100644
--- a/libs/ui/KisApplication.cpp
+++ b/libs/ui/KisApplication.cpp
@@ -96,6 +96,9 @@
 #include <KritaVersionWrapper.h>
 #include <dialogs/KisSessionManagerDialog.h>
 
+#include "widgets/KisScreenColorPicker.h"
+#include "KisDlgInternalColorSelector.h"
+
 namespace {
 const QTime appStartTime(QTime::currentTime());
 }
@@ -159,6 +162,9 @@ KisApplication::KisApplication(const QString &key, int &argc, \
char **argv)  setMouseCoalescingEnabled(false);
 #endif
 
+    KisDlgInternalColorSelector::s_screenColorPickerFactory = \
KisScreenColorPicker::createScreenColorPicker; +
+
     QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath());
 
     setApplicationDisplayName("Krita");
diff --git a/libs/ui/widgets/KisScreenColorPicker.cpp \
b/libs/ui/widgets/KisScreenColorPicker.cpp index e0cb7984b32..90b6dbe817b 100644
--- a/libs/ui/widgets/KisScreenColorPicker.cpp
+++ b/libs/ui/widgets/KisScreenColorPicker.cpp
@@ -272,6 +272,3 @@ bool KisScreenColorPickingEventFilter::eventFilter(QObject *, \
QEvent *event)  return false;
 }
 
-std::function<KisScreenColorPickerBase *(QWidget *)> \
KisDlgInternalColorSelector::s_screenColorPickerFactory = \
                KisScreenColorPicker::createScreenColorPicker;
-
-#include "KisScreenColorPicker.moc"
diff --git a/libs/widgets/KisDlgInternalColorSelector.h \
b/libs/widgets/KisDlgInternalColorSelector.h index d4c322b185f..f6b1fe5c76d 100644
--- a/libs/widgets/KisDlgInternalColorSelector.h
+++ b/libs/widgets/KisDlgInternalColorSelector.h
@@ -39,10 +39,12 @@ class KRITAWIDGETS_EXPORT KisDlgInternalColorSelector : public \
QDialog  {
     Q_OBJECT
 
-private:
+public:
+
+
     static std::function<KisScreenColorPickerBase *(QWidget *)> \
s_screenColorPickerFactory;  
-public:
+
     struct Config
     {
         Config() :


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic