После компиляции получаю ошибку типа undefined reference to `_imp___ZN10QtMobility7QSensor5startEv' и ни как не могу найти что нужно прописать в pro файле дабы все починилось ....
Помогите кто может, пожалуйста !
Вот ошибка которую я получаю:
Code:Running build steps for project lenon... Configuration unchanged, skipping qmake step. Starting: C:/NokiaQtSDK/mingw/bin/mingw32-make.exe -w mingw32-make: Entering directory `C:/Users/lenon/Documents/Quty/lenon-build-simulator' C:/NokiaQtSDK/mingw/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory `C:/Users/lenon/Documents/Quty/lenon-build-simulator' linking debug\lenon.exe mingw32-make[1]: Leaving directory `C:/Users/lenon/Documents/Quty/lenon-build-simulator' mingw32-make: Leaving directory `C:/Users/lenon/Documents/Quty/lenon-build-simulator' debug/widget.o: In function `Widget': C:\Users\lenon\Documents\Quty\lenon-build-simulator/../lenon/widget.cpp:21: undefined reference to `_imp___ZN10QtMobility7QSensor5startEv' C:\Users\lenon\Documents\Quty\lenon-build-simulator/../lenon/widget.cpp:21: undefined reference to `_imp___ZN10QtMobility7QSensor5startEv' debug/widget.o: In function `QAccelerometer': c:/NokiaQtSDK/Simulator/QtMobility/mingw/include/qaccelerometer.h:81: undefined reference to `_imp___ZN10QtMobility14QAccelerometer4typeE' c:/NokiaQtSDK/Simulator/QtMobility/mingw/include/qaccelerometer.h:81: undefined reference to `_imp___ZN10QtMobility7QSensorC2ERK10QByteArrayP7QObject' c:/NokiaQtSDK/Simulator/QtMobility/mingw/include/qaccelerometer.h:81: undefined reference to `_imp___ZTVN10QtMobility14QAccelerometerE' collect2: ld returned 1 exit status mingw32-make[1]: *** [debug\lenon.exe] Error 1 mingw32-make: *** [debug] Error 2 Exited with code 2. Error while building project lenon (target: Qt Simulator) When executing build step 'Make'
Вот содержимое файла .pro
а вот код widget.cppCode:QT += core gui QT += network TARGET = lenon TEMPLATE = app SOURCES += main.cpp\ widget.cpp HEADERS += widget.h FORMS += widget.ui CONFIG += mobility MOBILITY = location symbian { TARGET.UID3 = 0xe2ad2782 TARGET.CAPABILITY = UserEnvironment WriteDeviceData ReadDeviceData NetworkServices SwEvent TARGET.EPOCSTACKSIZE = 0x14000 TARGET.EPOCHEAPSIZE = 0x020000 0x800000 }
Code:#include "widget.h" #include "ui_widget.h" #include <QAccelerometer> Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); /* // start the sensor QSensor sensor("QAccelerometer"); sensor.start(); // later QSensorReading *reading = sensor.reading(); qreal x = reading->property("x").value<qreal>(); qreal y = reading->value(1).value<qreal>(); */ QAccelerometer *sensor= new QAccelerometer(this); sensor->start(); // if(sensor->isActive()) { //} }

Reply With Quote



