Question


Sorry to being a noob, but I just moved from Window, Eclipse and Java to OpenSUSE, C++ and Qt Creator, and I met a problem. I am working to create a QGIS application, I have the *.h files in /usr/include/gqis, and *.so files in /usr/lib. I added this line

INCLUDEPATH += /usr/local/include/qgis

at the end of .pro file of project so I can include QGIS library. So far as I coded, everything went smoothly, but when I built the project, Qt Creator threw an error:

qgis.h: No such file or directory
/usr/include/qgis/qgsapplication.h

and it mapped to line 4:

#include <QtGui/QApplication>
#include "mainwindow.h"
#include <qgis/qgsvectorlayer.h>
#include <qgis/qgsapplication.h>
#include <qgis/qgsproviderregistry.h>
#include <qgis/qgssinglesymbolrenderer.h>
#include <qgis/qgsmaplayerregistry.h>
#include <qgis/qgsvectorlayer.h>
#include <qgis/qgsmapcanvas.h>

As far as I searched, I am still unable to solve this problem. Please can anyone help me?

Was it helpful?

Solution

You should do:

INCLUDEPATH += /usr/local/include/qgis

and

#include <QtGui/QApplication>
#include "mainwindow.h"
#include <qgsvectorlayer.h>
#include <qgsapplication.h>
#include <qgsproviderregistry.h>
#include <qgssinglesymbolrenderer.h>
#include <qgsmaplayerregistry.h>
#include <qgsvectorlayer.h>
#include <qgsmapcanvas.h>

OTHER TIPS

Try just:

INCLUDEPATH += /usr/local/include/

Afterall, the qgis is already listed in the #include <qgis/...> path.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top