Error Including QGeoPositionInfo

主宰稳场 提交于 2019-12-11 05:29:38

问题


I am new to Qt ,

I have been given this task where i should use GPS

so to use to GPS ,i only did this one line of code

 #include <QGeoPositionInfo>

and the following error appeared

In file included from ..\Project\mainwindow.cpp:3:
..\Project\/form.h:7:28: error: QGeoPositionInfo: No such file or directory

how can i solve this issue ? how can i get this file ?

please note that i have tried re installing Qt Creator...

Please be specific i would really appreciate that...


回答1:


QGeoPositionInfo is part of Qt Mobility, which is an extension to Qt.




回答2:


in .pro file add:

{CONFIG += mobility
MOBILITY +=location}

2:in header add:

{using namespace QTMobility}


来源:https://stackoverflow.com/questions/6956785/error-including-qgeopositioninfo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!