QtLocation fails to compile (latest stable branch)



  • /usr/local/Qt-5.1.0/include/QtQml/5.1.0/QtQml/private/qv8_p.h:42:24: fatal error: private/v8.h: No such file or directory

    This is the error. Has someone already compiled the QtLocation module ?


  • Lifetime Qt Champion

    Hi,

    You're not using the latest stable, it should be 5.1.1, can you try again with that one ?


  • Moderators



  • The issue is still the same with Qt 5.1.1



  • Problem is solved by using Qt 5.2.0. It seems that Qt 5.1 cannot be used, probably due to the change of Javascript engine.



  • Hi,
    I downloaded Qt5.2.1. With the terminal "Qt 5.2.1 for Desktop (MinGW 4.8 32 bit)" I ran
    @qmake
    mingw32-make.exe install@

    but I get this error:
    @In file included from ....\include\QtPositioning\5.3.0/QtPositioning/private/qdoublevector2d_p.h:1:0,
    from maps\qgeocameratiles.cpp:47:
    ....\include\QtPositioning\5.3.0/QtPositioning/private/../../../../../src/positioning/qdoublevector2d_p.h: In constructor 'constexpr QDoubleVector2D::QDoubleVector2D(const QVector2D&)':
    ....\include\QtPositioning\5.3.0/QtPositioning/private/../../../../../src/positioning/qdoublevector2d_p.h:76:93: error: call to non-constexpr function 'float QVector2D::x() const'
    Q_DECL_CONSTEXPR explicit inline QDoubleVector2D(const QVector2D &vector) : xp(vector.x()), yp(vector.y()) {}
    ^
    ....\include\QtPositioning\5.3.0/QtPositioning/private/../../../../../src/positioning/qdoublevector2d_p.h: In member function 'constexpr QDoubleVector2D::operator QVector2D() const':
    ....\include\QtPositioning\5.3.0/QtPositioning/private/../../../../../src/positioning/qdoublevector2d_p.h:77:29: error: invalid return type 'QVector2D' of constexpr function 'constexpr QDoubleVector2D::operator QVector2D() const'
    Q_DECL_CONSTEXPR inline operator QVector2D() const { return QVector2D(xp, yp); }
    ^
    In file included from C:\Qt\Qt5.2.1\5.2.1\mingw48_32\include\QtGui/QVector2D:1:0,
    from ....\include\QtPositioning\5.3.0/QtPositioning/private/../../../../../src/positioning/qdoublevector2d_p.h:57,
    from ....\include\QtPositioning\5.3.0/QtPositioning/private/qdoublevector2d_p.h:1,
    from maps\qgeocameratiles.cpp:47:
    C:\Qt\Qt5.2.1\5.2.1\mingw48_32\include\QtGui/qvector2d.h:57:20: note: 'QVector2D' is not literal because:
    class Q_GUI_EXPORT QVector2D
    ^
    C:\Qt\Qt5.2.1\5.2.1\mingw48_32\include\QtGui/qvector2d.h:57:20: note: 'QVector2D' is not an aggregate, does not have a trivial default constructor, and has no constexpr constructor that is not a copy or move constructor
    In file included from ....\include\QtPositioning\5.3.0/QtPositioning/private/qdoublevector3d_p.h:1:0,
    from maps\qgeocameratiles.cpp:48:
    ....\include\QtPositioning\5.3.0/QtPositioning/private/../../../../../src/positioning/qdoublevector3d_p.h: In constructor 'constexpr QDoubleVector3D::QDoubleVector3D(const QVector3D&)':
    ....\include\QtPositioning\5.3.0/QtPositioning/private/../../../../../src/positioning/qdoublevector3d_p.h:75:93: error: call to non-constexpr function 'float QVector3D::x() const'
    Q_DECL_CONSTEXPR explicit inline QDoubleVector3D(const QVector3D &vector) : xp(vector.x()), yp(vector.y()), zp(vector.z()) {}
    ^
    In file included from ....\include\QtPositioning\5.3.0/QtPositioning/private/qdoublevector3d_p.h:1:0,
    from maps\qgeocameratiles.cpp:48:
    ....\include\QtPositioning\5.3.0/QtPositioning/private/../../../../../src/positioning/qdoublevector3d_p.h: In member function 'constexpr QDoubleVector3D::operator QVector3D() const':
    ....\include\QtPositioning\5.3.0/QtPositioning/private/../../../../../src/positioning/qdoublevector3d_p.h:76:29: error: invalid return type 'QVector3D' of constexpr function 'constexpr QDoubleVector3D::operator QVector3D() const'
    Q_DECL_CONSTEXPR inline operator QVector3D() const { return QVector3D(xp, yp, zp); }
    ^
    In file included from C:\Qt\Qt5.2.1\5.2.1\mingw48_32\include\QtGui/QVector3D:1:0,
    from ....\include\QtPositioning\5.3.0/QtPositioning/private/../../../../../src/positioning/qdoublevector3d_p.h:57,
    from ....\include\QtPositioning\5.3.0/QtPositioning/private/qdoublevector3d_p.h:1,
    from maps\qgeocameratiles.cpp:48:
    C:\Qt\Qt5.2.1\5.2.1\mingw48_32\include\QtGui/qvector3d.h:57:20: note: 'QVector3D' is not literal because:
    class Q_GUI_EXPORT QVector3D
    ^
    C:\Qt\Qt5.2.1\5.2.1\mingw48_32\include\QtGui/qvector3d.h:57:20: note: 'QVector3D' is not an aggregate, does not have a trivial default constructor, and has no constexpr constructor that is not a copy or move constructor
    Makefile.Release:3503: recipe for target '.obj/release/qgeocameratiles.o' failed
    mingw32-make[3]: *** [.obj/release/qgeocameratiles.o] Error 1
    mingw32-make[3]: Leaving directory 'C:/Qt/Qt5.2.1/qtlocation/src/location'
    mingw32-make[2]: *** [release-install] Error 2
    Makefile:44: recipe for target 'release-install' failed
    mingw32-make[1]: *** [sub-location-install_subtargets] Error 2
    mingw32-make[2]: Leaving directory 'C:/Qt/Qt5.2.1/qtlocation/src/location'
    Makefile:158: recipe for target 'sub-location-install_subtargets' failed
    mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.2.1/qtlocation/src'
    makefile:52: recipe for target 'sub-src-install_subtargets' failed
    mingw32-make: *** [sub-src-install_subtargets] Error 2
    15:43:20: Le processus "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" s'est terminé avec le code 2.
    Erreur lors de la compilation/déploiement du projet qtlocation (kit : Desktop Qt 5.2.1 MinGW 32bit)
    Lors de l'exécution de l'étape "Make"@
    And I don't know what went wrong.
    Thanks,
    Lauriane


  • Moderators

    Hi lauriane,

    Which features are you looking for? "Qt Positioning":http://qt-project.org/doc/qt-5/qtpositioning-index.html is already part of Qt 5.2



  • Hi,
    I was looking for Qt Location
    In fact, I can't have marble work with Qt5, so I thought Qt Location could make the deal
    Lauriane


  • Moderators

    Which part of Qt Location? It has been split up. See the Qt Positioning link I posted.

    Do you mean KDE Marble? It seems to be written for Qt 4, which has "incompatibilities with Qt 5":http://qt-project.org/doc/qt-5/portingguide.html

    Try building with Qt 4 instead.



  • I am trying with marble in parallel, but what I want is to display maps in my qml application.
    I saw that with QtLocation I could display maps, and I wanted to try.
    I saw that QtLocation was split into QtPositioning and QtLocation, it is the second one that I want.



  • I remove the "Q_DECL_CONSTEXPR" in lines 76 and 77 of qdoublevector2d_p.h and in lines 75 and 76 of qdoublevector3d_p.h. This way, the compilation ended without error.
    But my application is not running. In the .pro I added the line
    @QT += location@

    and main.qml is:
    @import QtQuick 2.0
    import QtLocation 5.0

    Item{
    width: 500
    height: 500

    Map{
        id: map
        anchors.fill: parent
    
        center: Coordinate{latitude: -27; longitude: 153}
        zoomLevel: map.minimumZoomLevel
    }
    

    }@
    it get the error message:
    @Coordinate is not a type
    center: Coordinate{latitude: -27; longitude: 153}
    ^@


  • Moderators

    "coordinate" is lowercase, and comes from Qt Positioning: http://qt-project.org/doc/qt-5/qml-coordinate.html

    Keep in mind also that Qt Location is incomplete -- that is why it has not yet been released.



  • Ok, thanks
    It works if I write

    @import QtQuick 2.0
    import QtLocation 5.0
    import QtPositioning 5.2

    Item{
    width: 500
    height: 500

    Location{
        id: location
        coordinate{latitude: -27; longitude: 153}
    }
    Map{
        id: map
        anchors.fill: parent
     
        center: location.coordinate
        zoomLevel: map.minimumZoomLevel
    }
    

    }
    @


  • Moderators

    Great! Happy coding :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.