Hi,
I am trying to link an application using QGIS API. Everything works on Linux but in Windows (QT 4.8.1 + Visual Studio Express 2010) I get:
1>maptoolselect.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QgsVectorLayer::staticMetaObject" (?staticMetaObject@QgsVectorLayer@@2UQMetaObject@@B)
1>mapwidget.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QgsVectorLayer::staticMetaObject" (?staticMetaObject@QgsVectorLayer@@2UQMetaObject@@B)
1>mapwidget.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QgsRasterLayer::staticMetaObject" (?staticMetaObject@QgsRasterLayer@@2UQMetaObject@@B)
1>debug\\nile.exe : fatal error LNK1120: 2 unresolved externals
1>maptoolselect.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QgsVectorLayer::staticMetaObject" (?staticMetaObject@QgsVectorLayer@@2UQMetaObject@@B)
1>mapwidget.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QgsVectorLayer::staticMetaObject" (?staticMetaObject@QgsVectorLayer@@2UQMetaObject@@B)
1>mapwidget.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QgsRasterLayer::staticMetaObject" (?staticMetaObject@QgsRasterLayer@@2UQMetaObject@@B)
1>debug\\nile.exe : fatal error LNK1120: 2 unresolved externals
To copy to clipboard, switch view to plain text mode
my pro file is defined as:
QT += core gui sql xml
TARGET = nile
TEMPLATE = app
unix:INCLUDEPATH += /usr/local/gis/include/qgis /usr/local/gis/include ./mapviewsrc
win32:INCLUDEPATH += C:/QGIS/apps/qgis/include C:/QGIS/include ./mapviewsrc
unix:LIBS += -L/usr/local/gis/lib -lgdal -lgeos -lqgis_core -lqgis_gui
win32:LIBS += C:/QGIS/apps/qgis/lib/qgis_core.lib C:/QGIS/apps/qgis/lib/qgis_gui.lib C:/QGIS/lib/geos_c_i.lib C:/QGIS/lib/gdal_i.lib
CONFIG += release
DEFINES += QGISPLUGINDIR=$${QGISPLUGINDIR} CORE_EXPORT= GUI_EXPORT=
QT += core gui sql xml
TARGET = nile
TEMPLATE = app
unix:INCLUDEPATH += /usr/local/gis/include/qgis /usr/local/gis/include ./mapviewsrc
win32:INCLUDEPATH += C:/QGIS/apps/qgis/include C:/QGIS/include ./mapviewsrc
unix:LIBS += -L/usr/local/gis/lib -lgdal -lgeos -lqgis_core -lqgis_gui
win32:LIBS += C:/QGIS/apps/qgis/lib/qgis_core.lib C:/QGIS/apps/qgis/lib/qgis_gui.lib C:/QGIS/lib/geos_c_i.lib C:/QGIS/lib/gdal_i.lib
CONFIG += release
DEFINES += QGISPLUGINDIR=$${QGISPLUGINDIR} CORE_EXPORT= GUI_EXPORT=
To copy to clipboard, switch view to plain text mode
I tried to generate a Visual Studio project with
qmake -tp vc
qmake -tp vc
To copy to clipboard, switch view to plain text mode
but I get the same error.
Any help is much appreciated!.
Carlos
Bookmarks