Hi Anatoliy,
I'm not in the position to comment on the actual problems, sorry.
But can you please try QGIS master in the same setting?
Because that is the branch where all energy is put into at the moment.
2.18 had some experimental work for compiling with qt5 but is actually
qt4, but in current master we go Qt5 all the way...
Regards,
Richard Duivenvoorde
On 14-11-16 23:54, Anatoliy Golubev wrote:
---------- Forwarded message ----------
From: Anatoliy Golubev <[email protected]>
Date: 2016-11-15 1:49 GMT+03:00
Subject: [Qt5] Compilation problems on windows
To: qgis-developer <[email protected]>
Hi devs!
I compiled QGIS 2.18 with Qt 5.3.2 and Visual Studio 2013. There are
some problems:
0. VS 2013 dont support `noexcept` keyword and throws
qgsfield.h(383): error C3646: 'noexcept' : unknown override specifier
Setting USE_CXX_11 to FALSE manually lead to following error:
3> Generating ui_qgsrelationreferenceconfigdlgbase.h
4>C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\xkeycheck.h(211): warning C4005: 'noexcept' : macro
redefinition
4> command-line arguments : see previous definition of 'noexcept'
4>C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\xkeycheck.h(212): warning C4005: 'nullptr' : macro
redefinition
4> command-line arguments : see previous definition of 'nullptr'
4>C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\xkeycheck.h(246): warning C4005: 'override' : macro
redefinition
4> command-line arguments : see previous definition of 'override'
4>C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\include\xkeycheck.h(250): fatal error C1189: #error : The C++
Standard Library forbids macroizing keywords. Enable warning C4005 to
find the forbidden macro.
I added this defines to CMakeLists.txt to disable C1189 error and
redefine only noexcept:
ELSEIF (MSVC AND MSVC_VERSION GREATER 1600)
SET(USE_CXX_11 TRUE)
+ ADD_DEFINITIONS("-D_ALLOW_KEYWORD_MACROS=1")
+ ADD_DEFINITIONS("-Dnoexcept=")
1. Q_WS_* macroses changed to Q_OS_* in Qt5
Q_WS_WIN macro in 'src/core/geometry/qgsgeometry.cpp:48' breaks
compilation on Windows.
2. Linking of all executables fails with:
2>MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol
_WinMain@16 referenced in function ___tmainCRTStartup
2>D:\Projects\QGIS\build\output\Release\qgis_help.exe : fatal error
LNK1120: 1 unresolved externals
It is related to CMake Warning:
CMake Warning (dev) in src/helpviewer/CMakeLists.txt:
Policy CMP0020 is not set: Automatically link Qt executables to qtmain
target on Windows. Run "cmake --help-policy CMP0020" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
Added 'CMAKE_POLICY (SET CMP0020 NEW)' to following files:
- src/app/CMakeLists.txt
- src/browser/CMakeLists.txt
- src/helpviewer/CmakeLists.txt
Setting this to root CMakeLists.txt has no effect, dont know why.
3. Running debug build fails with assert in method 'void
QgsMapLayerModel::addLayers( const QList<QgsMapLayer *>& layers )'
line 96 (layers list is empty).
qgis output - http://pastebin.com/zaHv0hpz
call stack - http://pastebin.com/PVV8bsLW
Adding 'if ( layers.isEmpty() ) return;' fix this.
4. Multiple warnings:
6>qgis_core.lib(qgis_core.dll) : warning LNK4006: "public: __thiscall
QVector<class QVariant>::QVector<class QVariant>(class QVector<class
QVariant> const &)" (??0?$QVector@VQVariant@@@@QAE@ABV0@@Z) already
defined in qgsgraph.obj; second definition ignored
6>qgis_core.lib(qgis_core.dll) : warning LNK4006: "public: __thiscall
QVector<class QVariant>::~QVector<class QVariant>(void)"
(??1?$QVector@VQVariant@@@@QAE@XZ) already defined in qgsgraph.obj;
second definition ignored
6>qgis_core.lib(qgis_core.dll) : warning LNK4006: "public: class
QVector<class QVariant> & __thiscall QVector<class
QVariant>::operator=(class QVector<class QVariant> const &)"
(??4?$QVector@VQVariant@@@@QAEAAV0@ABV0@@Z) already defined in
qgsgraph.obj; second definition ignored
6>qgis_core.lib(qgis_core.dll) : warning LNK4006: "public: __thiscall
QVector<class QVariant>::QVector<class QVariant>(void)"
(??0?$QVector@VQVariant@@@@QAE@XZ) already defined in qgsgraph.obj;
second definition ignored.
Thats all ^_^
_______________________________________________
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer