Qt Creator build project - No such file or directory

14,464

Solution 1

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>

Solution 2

Try just:

INCLUDEPATH += /usr/local/include/

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

Share:
14,464

Related videos on Youtube

Anh Tuan
Author by

Anh Tuan

Updated on June 04, 2022

Comments

  • Anh Tuan
    Anh Tuan almost 2 years


    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?

  • Anh Tuan
    Anh Tuan about 12 years
    This doesn't solve the problem, but anyway thanks for your help