Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor sami.mahjoub's Avatar
    Join Date
    Dec 2010
    Posts
    63
    I have a really project to test some fonction on Mobility API
    But I have a really strange error !

    This is my code:
    #include <QMainWindow>
    #include <qmobilityglobal.h>
    #include <QGeoPositionInfo>
    #include <QGeoPositionInfoSource>
    #include <QObject>

    class MyClass : public QObject
    {

    Q_OBJECT
    public:
    MyClass(QObject *parent = 0)
    : QObject(parent)
    {
    QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(this);
    if (source) {
    connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),
    this, SLOT(positionUpdated(QGeoPositionInfo)));
    source->startUpdates();
    }
    }

    public slots:
    void positionUpdated(QGeoPositionInfo & info)
    {
    qDebug() << "Position updated:" << info;
    }
    };
    this is the .pro file

    QT += core gui
    QT += core

    TARGET = testgraphique
    TEMPLATE = app


    SOURCES += main.cpp\
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    CONFIG += mobility
    MOBILITY = location

    symbian {
    TARGET.UID3 = 0xe62b586b
    # TARGET.CAPABILITY +=
    TARGET.EPOCSTACKSIZE = 0x14000
    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    }

    unix:!symbian {
    maemo5 {
    target.path = /opt/usr/bin
    } else {
    target.path = /usr/local/bin
    }
    INSTALLS += target
    }
    And this are errors:
    /home/ubis/QtSDK/works/testgraphique-build-maemo/../testgraphique/mainwindow.h:29: erreur : 'QGeoPositionInfo' has not been declared
    /home/ubis/QtSDK/works/testgraphique-build-maemo/../testgraphique/mainwindow.h:20: erreur : 'QGeoPositionInfoSource' was not declared in this scope
    /home/ubis/QtSDK/works/testgraphique-build-maemo/../testgraphique/mainwindow.h:20: erreur : 'source' was not declared in this scope
    /home/ubis/QtSDK/works/testgraphique-build-maemo/../testgraphique/mainwindow.h:20: erreur : 'QGeoPositionInfoSource' is not a class or namespace
    /home/ubis/QtSDK/works/testgraphique-build-maemo/../testgraphique/mainwindow.h:31: erreur : invalid use of incomplete type 'struct QDebug'
    /home/ubis/QtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim//usr/include/QtCore/qglobal.h:1654: erreur : forward declaration of 'struct QDebug'
    Any help will be appreciated

  2. #2
    Nokia Developer Champion somnathbanik's Avatar
    Join Date
    Dec 2008
    Posts
    2,289
    For which platform are you build this project and what is being selected in the "Build Configuration" under project icon

  3. #3
    Regular Contributor sami.mahjoub's Avatar
    Join Date
    Dec 2010
    Posts
    63
    it's for Nokia N900 and for the build configuration it's "Qt for Fremantle PR1.3 Devices (Qt SDK)"

  4. #4
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    There are over 9000 similar questions on DiBo. It looks like Maemo target is incomplete (probably as result of running SDK updater).

  5. #5
    Nokia Developer Champion glebovitz's Avatar
    Join Date
    May 2009
    Posts
    4
    Are you running Qt SDK 1.1 Beta or Qt SDK 1.1 RC? What OS are you using as the build host?

    I just tried out you code on Qt SDK 1.1 Beta on x86 Linux and had no issues. Here is my .pro file:


    # Add files and directories to ship with the application
    # by adapting the examples below.
    # file1.source = myfile
    # dir1.source = mydir
    DEPLOYMENTFOLDERS = # file1 dir1

    symbian:TARGET.UID3 = 0xE79C2677

    # Allow network access on Symbian
    symbian:TARGET.CAPABILITY += NetworkServices

    # If your application uses the Qt Mobility libraries, uncomment
    # the following lines and add the respective components to the
    # MOBILITY variable.
    # CONFIG += mobility
    # MOBILITY +=

    SOURCES += main.cpp mainwindow.cpp \
    myobject.cpp
    HEADERS += mainwindow.h \
    myobject.h
    FORMS += mainwindow.ui

    CONFIG += mobility
    MOBILITY += location

    # Please do not modify the following two lines. Required for deployment.
    include(deployment.pri)
    qtcAddDeployment()

  6. #6
    Nokia Developer Champion danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    Isn't he just missing the obscure "using" statement?

  7. #7
    Regular Contributor sami.mahjoub's Avatar
    Join Date
    Dec 2010
    Posts
    63
    Thanks every body !
    it was "QTM_USE_NAMESPACE" missing on my header file !

Similar Threads

  1. Module not recognized
    By tranzy in forum Python
    Replies: 4
    Last Post: 2010-03-14, 19:56
  2. Connected Phone Was Not Recognized
    By tanginaka in forum General Development Questions
    Replies: 4
    Last Post: 2008-10-14, 08:55
  3. USB Device not recognized
    By ndcs44 in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2008-04-21, 14:19
  4. Format not recognized
    By rylagrace in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2008-03-11, 00:32
  5. Resource not recognized
    By smlobo in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-04-08, 15:23

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved