From e160bb02ffc6bed327e4a886b529ab738921b1bb Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 15 Sep 2022 15:01:45 +0300 Subject: [PATCH] In C++11 a static constexpr member variable, unlike every other kind of constexpr global variable, has external linkage, thus must be explicitly defined somewhere. This flaw is fixed in C++17. --- src/libs/vgeometry/vabstractcurve.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libs/vgeometry/vabstractcurve.cpp b/src/libs/vgeometry/vabstractcurve.cpp index 02fe1a5a2..63c15e4c9 100644 --- a/src/libs/vgeometry/vabstractcurve.cpp +++ b/src/libs/vgeometry/vabstractcurve.cpp @@ -40,6 +40,12 @@ #include "../vmisc/compatibility.h" #include "../ifc/exception/vexceptionobjecterror.h" +// See https://stackoverflow.com/a/46719572/3045403 +#if __cplusplus < 201703L +constexpr qreal VAbstractCurve::minLength; // NOLINT(readability-redundant-declaration) +#endif + +//--------------------------------------------------------------------------------------------------------------------- VAbstractCurve::VAbstractCurve(const GOType &type, const quint32 &idObject, const Draw &mode) :VGObject(type, idObject, mode), d (new VAbstractCurveData()) {}