×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    4

    Unhappy QMobility и QAccelerometer undefined reference to

    После компиляции получаю ошибку типа 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

    Code:
    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
    }
    а вот код widget.cpp
    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()) {
    
        //}
    }

  2. #2
    Nokia Developer Champion
    Join Date
    Jul 2007
    Location
    Magnitogorsk, Russia
    Posts
    536

    Re: QMobility и QAccelerometer undefined reference to

    Если я правильно понимаю табличку по следующей ссылке:
    http://doc.qt.nokia.com/qtmobility-1...-compatability

    То сенсоры под Symbian еще не поддерживаются.

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    4

    Re: QMobility и QAccelerometer undefined reference to

    Quote Originally Posted by Den123 View Post
    Если я правильно понимаю табличку по следующей ссылке:
    http://doc.qt.nokia.com/qtmobility-1...-compatability

    То сенсоры под Symbian еще не поддерживаются.
    спасибо! Я вроде прописал MOBILITY += sensors и ошибка ушла! К стати все работает, только не в эмуляторе а на самом аппарате
    Last edited by alenon; 2010-05-20 at 18:26.

Similar Threads

  1. Replies: 1
    Last Post: 2009-10-12, 11:22
  2. Do not get response in movino-symbian application.
    By SymbianTH in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2009-09-17, 10:09
  3. [moved] HELP! Phone Debug (GCCE)
    By joseph.m in forum Symbian
    Replies: 18
    Last Post: 2008-07-14, 10:42
  4. carbide c++ can't find headers.!!
    By nokia_maniac in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 29
    Last Post: 2007-12-19, 12:54
  5. file not found
    By praktikant in forum Symbian
    Replies: 16
    Last Post: 2007-05-09, 15:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •