在Qt中使用GPS检索国家位置
Retreving Contry Location Using GPS in Qt
我是Qt的新手,我被赋予了这个任务…
使用GPS检测国家-并在文本框中显示。
好吧,因为我是新手,我不知道怎么做这样的事情。我开始在网上搜索
i end up here: http://www.developer.nokia.com/Community/Wiki/File:Qt_for_Maemo_Location_Example.zip
所以我下载了代码并运行它,出现了大量的错误
..liblocationlocationinfowidget.cpp:1:34: error: hildon/hildon-banner.h: No such file or directory
In file included from ..liblocationlocationinfowidget.cpp:5:
..liblocation/locationinfowidget.h:18: error: 'LocationGPSDeviceFix' has not been declared
..liblocation/locationinfowidget.h:20: error: 'LocationGPSDeviceStatus' has not been declared
..liblocation/locationinfowidget.h:23: error: 'LocationGPSDevice' has not been declared
..liblocation/locationinfowidget.h:23: error: 'gpointer' has not been declared
..liblocation/locationinfowidget.h:24: error: 'LocationGPSDevice' has not been declared
..liblocation/locationinfowidget.h:24: error: 'gpointer' has not been declared
..liblocation/locationinfowidget.h:25: error: 'LocationGPSDevice' has not been declared
..liblocation/locationinfowidget.h:25: error: 'gpointer' has not been declared
..liblocation/locationinfowidget.h:33: error: ISO C++ forbids declaration of 'LocationGPSDevice' with no type
..liblocation/locationinfowidget.h:33: error: expected ';' before '*' token
..liblocation/locationinfowidget.h:34: error: ISO C++ forbids declaration of 'LocationGPSDControl' with no type
..liblocation/locationinfowidget.h:34: error: expected ';' before '*' token
..liblocationlocationinfowidget.cpp: In constructor 'LocationInfoWidget::LocationInfoWidget(QWidget*)':
..liblocationlocationinfowidget.cpp:33: error: 'control' was not declared in this scope
..liblocationlocationinfowidget.cpp:33: error: 'location_gpsd_control_get_default' was not declared in this scope
..liblocationlocationinfowidget.cpp:35: error: 'location_gpsd_control_start' was not declared in this scope
..liblocationlocationinfowidget.cpp:37: error: 'device' was not declared in this scope
..liblocationlocationinfowidget.cpp:37: error: 'LocationGPSDevice' was not declared in this scope
..liblocationlocationinfowidget.cpp:37: error: expected primary-expression before ')' token
..liblocationlocationinfowidget.cpp:37: error: expected ';' before 'g_object_new'
..liblocationlocationinfowidget.cpp:40: error: 'G_CALLBACK' was not declared in this scope
..liblocationlocationinfowidget.cpp:40: error: 'g_signal_connect' was not declared in this scope
..liblocationlocationinfowidget.cpp: In destructor 'virtual LocationInfoWidget::~LocationInfoWidget()':
..liblocationlocationinfowidget.cpp:50: error: 'device' was not declared in this scope
..liblocationlocationinfowidget.cpp:51: error: 'g_object_unref' was not declared in this scope
..liblocationlocationinfowidget.cpp:53: error: 'control' was not declared in this scope
..liblocationlocationinfowidget.cpp:54: error: 'location_gpsd_control_stop' was not declared in this scope
..liblocationlocationinfowidget.cpp: At global scope:
..liblocationlocationinfowidget.cpp:57: error: variable or field 'updateStatus' declared void
..liblocationlocationinfowidget.cpp:57: error: 'LocationGPSDeviceStatus' was not declared in this scope
mingw32-make[1]: *** [debug/locationinfowidget.o] Error 1
mingw32-make: *** [debug] Error 2
所以我做错了吗?有更简单的方法来做这些事情吗?
第一个错误就说明了一切:" hildon/hildon-banner.h
: No such file or directory"
你至少错过了那个文件。可能该文件声明了LocationGPSDeviceFix
,这解释了第二个错误"'LocationGPSDeviceFix'未声明"。然后从那里开始走下坡路。在c++中,应该从上到下开始修复错误。
相关文章:
- 使用VerQueryValue检索应用程序的文件描述
- 是否可以从格式字符串中检索"width"
- 使用 pqxx 将 std::vector 存储在 postgresql 中,并从数据库中检索它
- 如何在QByteArray中放置和检索位字段而不会感到痛苦?
- 如何在Qt中从数据库中检索二进制数据?
- 如何从C++代码中检索 QML 的文本字段中的文本?
- 从 opencv c++ 中的矢量中检索固定的帧数
- 如何在不等待检索的情况下获取C++中的内存位置?
- 如何在 QTreeWidget 中检索特定项目的 mimeData?
- C++从字符串中检索几行
- 在数据库中插入和检索矩阵
- C++和带有国家符号的文件路径(也许用 UTF8 编码)
- 两个垫子的 OpenCV 数据是相同的,但使用 Mat::at 检索时的值已损坏
- 使用 const char* 键映射 C++ 检索空值
- 打印从SQLite3数据库检索的数据C++与命令行中相同的方式
- 如何检索指向在单独线程上运行的函数的移动指针?
- 如何检索 Steamwork SDK 的当前版本
- 通过 host() 从 af::array 检索数据会导致错误的数据
- 无法从类中检索值
- 在Qt中使用GPS检索国家位置