Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Cannot open include file: 'QGeoPositionInfoSource': No such file or directory



  • Hi all,
    I have a simple class I added to get the current lat long. I added the following to my .pro file:

    QT += positioning

    Below is my header file where the error is being received.

    #ifndef GPSCONTROLLER_H
    #define GPSCONTROLLER_H
    
    #include <QObject>
    #include <QGeoPositionInfoSource>
    #include <QGeoPositionInfo>
    
    class GpsController : public QObject
    {
        Q_OBJECT
    
    public:
        GpsController();
        void startGps();
    
    Q_SIGNALS:
        void positionChanged(qreal latitude, qreal longitude);
    
    private slots:
        void positionUpdated(QGeoPositionInfo geoPositionInfo);
    
    private:
        QGeoPositionInfoSource* _positionInfo;
    };
    
    #endif // GPSCONTROLLER_H
    

    Am I missing something? Also, I noticed I do not need the #include <QGeoPositionInfo> and I wonder why but that is secondary to the problem I'm having.

    Thanks!



  • All,
    I fixed the issue. I had to run qmake.


Log in to reply