Hello, I'm trying to get a simple application compiled in windows, using location from QtMobility.
I have downloaded the location from git and i have written a simple code such as
----------gpsTrackerWindow.cpp------------
#include "GpsTrackerWindow.h"
#include <QtGui>
#include <iostream>
#include <qgeopositioninfosource.h>
GpsTrackerWindow::GpsTrackerWindow(){
//gui initialization
guiInit();
//
QGeoPositionInfoSource *source;
QGeoPositionInfoSource::createDefaultSource(source);
if (source) {
connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),this, SLOT(positionUpdated(QGeoPositionInfo)));
source->setUpdateInterval(1000);//set update each second
source->startUpdates();
}
}
void GpsTrackerWindow:ositionUpdated(const QGeoPositionInfo &info){
//output a message with the info
}
void GpsTrackerWindow::guiInit(){
//gui init things
}
------------- gpsTrackerWindow.h ---------------------------
#ifndef GPSTRACKERWINDOW_H
#define GPSTRACKERWINDOW_H
#include <QtGui/QWidget>
class QVBoxLayout;
class QLabel;
class QGeoPositionInfo;
class GpsTrackerWindow : public QWidget
{
Q_OBJECT
public:
GpsTrackerWindow();
signals:
public slots:
protected:
private slots:
void guiInit();
void positionUpdated(const QGeoPositionInfo &info);
private:
QLabel *latitude;
QLabel *longitude;
QLabel *date;
QLabel *velocity;
QLabel *altitude;
QLabel *bearing;
QVBoxLayout *mainLayout;
};
#endif //GPSTRACKERWINDOW_H
------------ gpsTesteFinal.pro ----------------
# ----------------------------------------------------
# This file is generated by the Qt Visual Studio Add-in.
# ------------------------------------------------------
# This is a reminder that you are using a generated .pro file.
# Remove it when you are finished editing this file.
message("You are running qmake on a generated .pro file. This may not work!")
TEMPLATE=app
TARGET = gpsTesteFinal
HEADERS = gpsTrackerWindow.h
SOURCES = gpsTrackerWindow.cpp \
main.cpp
LIBS += -lQtLocation
DESTDIR = ./Debug
CONFIG += debug
DEFINES += UNDER_CE WINCE _WINDOWS _UNICODE _WIN32 QT_NO_PRINTER QT_NO_PRINTDIALOG ARMV4I _ARMV4I_ armv4i _ARM_ ARM _M_ARM ARM __arm__ Q_OS_WINCE_WM QT_NO_PRINTER QT_NO_PRINTDIALOG _WIN32_WCE=0x502
INCLUDEPATH += ./GeneratedFiles \
./GeneratedFiles/Debug \
. \
./../../location
DEPENDPATH += .
MOC_DIR += ./GeneratedFiles/debug
OBJECTS_DIR += debug
UI_DIR += ./GeneratedFiles
RCC_DIR += ./GeneratedFiles
include(./../../common.pri)
include(gpsTesteFinal.pri)
My file structure is set as the following:
workspace
|
|_ location
|
|_bin
|_build
|_examples
| |
| |_fetchgooglemaps
| |_gpsTesteFinal
| |_(source files: .cpp, .h, .pro, ...)
|
|
|_location
| |_(location files: .cpp, .h)
|
|_common.pri
when i try to compile it under visual studio, i get the following error:
.\gpsTrackerWindow.cpp(5) : fatal error C1083: Cannot open include file: 'qgeopositioninfosource.h': No such file or directory
and i cant understand why. the includepath in the .pro file seems correct to me, so i don't understand why it dosn't reach the file.
can someone help me?
all the best

ositionUpdated(const QGeoPositionInfo &info){
Reply With Quote


