c++ - QGIS cannot find headers file -
i'm trying create custom qgis desktop application qt 5.9.1
i have downloaded osgeo4w (x64) geospatial software set , github c++ qgis samples i'm facing error @ compile time:
cannot open include file: 'qgsmapcanvas.h': no such file or directory
actually none of above headers files under osgeo4w folder:
#include <qgsapplication.h> #include <qgsproviderregistry.h> #include <qgssinglesymbolrenderer.h> #include <qgsmaplayerregistry.h> #include <qgsrasterlayer.h> #include <qgsmapcanvas.h>
but..shouldn't in dll libraries (eg qgis_core, qgis_gui ... ) ?
anyway, *.pro file:
template = app target = qgis_example4 qt = sql network svg gui core xml language= c++ includepath += "c:\\osgeo4w64\\include" libs += -l"c:\\osgeo4w64\\apps\\qgis\\bin" -lqgis_core -lqgis_gui -lgdal_i -lgeos_c defines+=core_export=__declspec(dllexport) defines+=gui_export=__declspec(dllexport) config += qt gui exceptions stl warn_on debug thread resources += resources.qrc forms += mainwindowbase.ui headers = mainwindow.h sources = main.cpp \ mainwindow.cpp
ps: there similar question on stackiverflow repeated because answers given did not give solution
solved: needed headers file found within "qgis-dev" branch of project.
osgeo4w : users cannot use osgeo4w reason or prefer there weekly snapshot of qgis-dev osgeo4w standalone installer
after installation can find header in:
c:/program files/qgis 2.99/apps/qgis-dev/include
so .pro file
template = app target = qgis_example4 qt = sql network svg gui core xml language= c++ includepath += "c:/program files/qgis 2.99/include" includepath += "c:/program files/qgis 2.99/apps/qgis-dev/include" libs += -l"c:/program files/qgis 2.99/apps/qgis-dev/bin" -lqgis_core -lqgis_gui defines+=core_export=__declspec(dllexport) defines+=gui_export=__declspec(dllexport) config += qt gui exceptions stl warn_on debug thread resources += resources.qrc forms += mainwindowbase.ui headers = mainwindow.h sources = main.cpp \ mainwindow.cpp
although files present, still not able run qgis samples. maybe i'll move other sample or i'll custom basic application.
Comments
Post a Comment