Skip to content

Commit

Permalink
Fix windows build
Browse files Browse the repository at this point in the history
undefined error C2079: 'QMapNode<Key,T>::value' uses undefined class 'QgsGeometry'
  • Loading branch information
jef-n committed May 12, 2017
1 parent 0e65077 commit 9ddd28d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/qgsfeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ typedef QMap<QgsFeatureId, QgsAttributeMap> QgsChangedAttributesMap;
typedef QMap<qint64, QMap<int, QVariant> > QgsChangedAttributesMap;
#endif

#include "qgsgeometry.h"

// key = feature id, value = changed geometry
#ifndef SIP_RUN
typedef QMap<QgsFeatureId, QgsGeometry> QgsGeometryMap;
Expand Down

4 comments on commit 9ddd28d

@jef-n
Copy link
Member Author

@jef-n jef-n commented on 9ddd28d May 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QgsGeometry needs QgsFeatureId, so the forward declaration of QgsGeometry cannot be simply replaced by the include.

@ismailsunni
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jef-n

I got an error when compile the master branch today (after long time no compiling). So, I do git bisect to find the problem, and I got this commit. My error is like this:

/usr/bin/clang++   -DENABLE_TESTS -DQGISDEBUG=1 -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_DISABLE_DEPRECATED_BEFORE=0 -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_CAST_TO_ASCII -DQT_POSITIONING_LIB -DQT_PRINTSUPPORT_LIB -DQT_SQL_LIB -DQT_SVG_LIB -DQT_UITOOLS_LIB -DQT_WEBKITWIDGETS_LIB -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DWITH_BINDINGS -DWITH_QTWEBKIT -Dgdalprovider_EXPORTS -I. -I/Users/ismailsunni/dev/cpp/QGIS/src/providers/gdal/../../core -I/Users/ismailsunni/dev/cpp/QGIS/src/providers/gdal/../../core/raster -I/Users/ismailsunni/dev/cpp/QGIS/src/providers/gdal/../../core/geometry -I/Users/ismailsunni/dev/cpp/QGIS/src/providers/gdal/../../core/metadata -I/Users/ismailsunni/dev/cpp/QGIS/src/providers/gdal/../../gui -Isrc/providers/gdal/../../ui -Isrc/core -Isrc/gui -isystem /usr/local/opt/gdal2/include -iframework /usr/local/opt/qt5/lib -isystem /usr/local/opt/qt5/lib/QtXml.framework/Headers -isystem /usr/local/opt/qt5/lib/QtCore.framework/Headers -isystem /usr/local/opt/qt5/./mkspecs/macx-clang -isystem /usr/local/opt/qt5/lib/QtConcurrent.framework/Headers -isystem /usr/local/opt/qt5/lib/QtGui.framework/Headers -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -isystem /usr/local/opt/qt5/lib/QtWidgets.framework/Headers -isystem /usr/local/opt/qt5/lib/QtPrintSupport.framework/Headers -isystem /usr/local/opt/qt5/lib/QtSvg.framework/Headers -isystem /usr/local/opt/qt5/lib/QtNetwork.framework/Headers -iframework /usr/local/opt/qt5-webkit/lib -isystem /usr/local/opt/qt5-webkit/lib/QtWebKit.framework/Headers -isystem /usr/local/opt/qt5-webkit/lib/QtWebKitWidgets.framework/Headers -isystem /usr/local/opt/qt5/lib/QtSql.framework/Headers -isystem /usr/local/opt/qt5/lib/QtPositioning.framework/Headers -isystem /usr/local/opt/qt5/include -isystem /usr/local/opt/qt5/include/QtUiTools -DSPATIALITE_VERSION_GE_4_0_0 -DSPATIALITE_VERSION_G_4_1_1 -DSPATIALITE_HAS_INIT_EX -Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing -Wno-return-type-c-linkage -Wno-overloaded-virtual -Qunused-arguments -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -fPIC -fvisibility=hidden   -F/usr/local/opt/qca/lib -F/usr/local/opt/qwt/lib  -fPIC -std=gnu++11 -MD -MT src/providers/gdal/CMakeFiles/gdalprovider.dir/moc_qgsgdaldataitems.cpp.o -MF src/providers/gdal/CMakeFiles/gdalprovider.dir/moc_qgsgdaldataitems.cpp.o.d -o src/providers/gdal/CMakeFiles/gdalprovider.dir/moc_qgsgdaldataitems.cpp.o -c /Users/ismailsunni/dev/cpp/QGIS-QtCreator-Ninja2/src/providers/gdal/moc_qgsgdaldataitems.cpp
In file included from /Users/ismailsunni/dev/cpp/QGIS-QtCreator-Ninja2/src/providers/gdal/moc_qgsgdaldataitems.cpp:9:
In file included from /Users/ismailsunni/dev/cpp/QGIS-QtCreator-Ninja2/src/providers/gdal/../../../../QGIS/src/providers/gdal/qgsgdaldataitems.h:18:
In file included from /Users/ismailsunni/dev/cpp/QGIS/src/providers/gdal/../../core/qgsdataitem.h:32:
In file included from /Users/ismailsunni/dev/cpp/QGIS/src/providers/gdal/../../core/qgsmaplayer.h:35:
In file included from /Users/ismailsunni/dev/cpp/QGIS/src/providers/gdal/../../core/qgsrendercontext.h:31:
In file included from /Users/ismailsunni/dev/cpp/QGIS/src/providers/gdal/../../core/qgsexpressioncontext.h:26:
In file included from /Users/ismailsunni/dev/cpp/QGIS/src/providers/gdal/../../core/qgsfeature.h:508:
/Users/ismailsunni/dev/cpp/QGIS/src/providers/gdal/../../core/geometry/qgsgeometry.h:24:10: fatal error: 'geos_c.h' file not found
#include <geos_c.h>
         ^
1 error generated.

I got 4 errors like that.

Do you know something about this problem?

I compiled in MacOS, it was fine before.

@jef-n
Copy link
Member Author

@jef-n jef-n commented on 9ddd28d May 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ismailsunni 3452e8d probably fixes it.

@ismailsunni
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reply @jef-n
I made a fix also in here #4599, I can compile again with that PR.

Please sign in to comment.