×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    19

    Code can't be built for real device (was. Code can't run on real device)

    I try to design a gps app for my 5800. When I test the code by simulator in QT creator it run fine, but when I try to build it on symbian device there are some error like: error: QtLocation/QGeoPositionInfoSource: No such file or directory

    Here is my *.pro:
    symbian: TARGET.CAPABILITY += NetworkServices Location
    #}
    # If your application uses the Qt Mobility libraries, uncomment
    # the following lines and add the respective components to the
    # MOBILITY variable.
    CONFIG += mobility
    MOBILITY += location
    #}

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

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


    I also try to change to TARGET.CAPABILITY += NetworkServices \ Location but not work as well
    Help pls?

  2. #2
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: Code can't run on real device

    Which SDK? What version? How does the code look like?
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    19

    Re: Code can't run on real device

    Qt SDK 1.1

    mainwindow.cpp:

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QAction>
    //#include <QLabel>
    #include <QtCore/QCoreApplication>
    #include <QtLocation/QGeoPositionInfo>
    #include <QtLocation/QGeoPositionInfoSource>
    QTM_USE_NAMESPACE
    Ui::MainWindow *ui;

    double m_latitude;
    double m_longitude;
    double try_latitude;
    double try_longitute;




    MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindow)
    {
    ui->setupUi(this);

    QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(this);
    if (source)
    {
    connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),this, SLOT(positionUpdated(QGeoPositionInfo)));
    source->startUpdates();


    }
    }

    void MainWindow:ositionUpdated(const QGeoPositionInfo &gpsPos)
    {


    QGeoCoordinate coord = gpsPos.coordinate();
    m_latitude = coord.latitude();
    m_longitude = coord.longitude();
    // ui->locationLabel->setText("aaaaaa");
    ui->locationLabel->setText(QString::number(m_latitude));

    }



    main.cpp
    #include "mainwindow.h"

    #include <QtGui/QApplication>
    #include <QtLocation/QGeoPositionInfoSource>
    #include <QtLocation/QGeoPositionInfo>
    QTM_USE_NAMESPACE
    double abc;
    QGeoPositionInfo trying;

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);

    MainWindow mainWindow;
    mainWindow.setOrientation(MainWindow::ScreenOrientationAuto);
    mainWindow.showExpanded();
    mainWindow.positionUpdated(trying);
    return app.exec();
    }



    i can run it on simulator without error.

  4. #4
    Nokia Developer Expert
    Join Date
    Dec 2009
    Posts
    81

    Re: Code can't be built for real device (was. Code can't run on real device)

    Does it work if you change
    TARGET.CAPABILITY += NetworkServices \ Location
    to
    TARGET.CAPABILITY += NetworkServices Location
    ?

    From:
    http://discussion.forum.nokia.com/fo...zation-problem

  5. #5
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Code can't be built for real device (was. Code can't run on real device)

    When one says "TARGET.CAPABILITY += NetworkServices \"
    followed on the next line by "Location", the "\" means "continued on the next line".

    If you put both capabilities on the same line, just separate them by a space.

    Or you can cay "TARGET.CAPABILITY += NetworkServices"
    and then "TARGET.CAPABILITY += Location"

    -- the "+=" means "append the value on the right to the string variable on the left"

  6. #6
    Registered User
    Join Date
    Feb 2011
    Posts
    19

    Re: Code can't be built for real device (was. Code can't run on real device)

    Thanks for reply. No. I also tried separate it into 2 line. But It doesn't work. It always show error: QGeoPositionInfo: No such file or directory and error: QGeoPositionInfoSource: No such file or directory
    i also tried clean build then build again but the result is same.

    Pls help to solve this problem. Thanks

  7. #7
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Code can't be built for real device (was. Code can't run on real device)

    Well, changing the capabilities won't eliminate that build error. If it's not a problem with CONFIG/MOBILITY statements then it's an SDK configuration problem.

  8. #8
    Registered User
    Join Date
    Feb 2011
    Posts
    19

    Re: Code can't be built for real device (was. Code can't run on real device)

    May i know how to solve it? And what i need to do to change my SDK configuration? Thanks...

Similar Threads

  1. Run J2ME Code in Real Device
    By lovely_chatterjee in forum Mobile Java General
    Replies: 10
    Last Post: 2011-01-13, 06:40
  2. Replies: 2
    Last Post: 2009-08-27, 07:28
  3. i can't play sound in nokia emulitar and real device
    By fevos in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2008-12-20, 21:37
  4. Can't install example to real device.
    By valexey in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 12
    Last Post: 2008-09-19, 07:39
  5. Can't install Nokia's example to real device
    By afka in forum Mobile Java General
    Replies: 3
    Last Post: 2007-04-30, 17:45

Posting Permissions

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