Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Registered User vitalisam's Avatar
    Join Date
    Jul 2010
    Posts
    5
    Hi,
    It's my first try of Nokia QT SDK under linux platform (Debian 5.0).

    I was trying to build an example: BatteryLevel indicator for Symbian. But SDK complains about this line,
    with error 'ISO C++ forbids declaration of ‘QSystemDeviceInfo’ with no type':

    Code:
    #include <QDialog>
    #include <QSystemInfo>
    
    namespace Ui {
        QTM_USE_NAMESPACE
        class BatteryIndicator;
    }
    
    class BatteryIndicator : public QDialog
    {
        Q_OBJECT
    
    public:
        explicit BatteryIndicator(QWidget *parent = 0);
        ~BatteryIndicator();
    
    private:
        QSystemDeviceInfo *deviceInfo;
        Ui::BatteryIndicator *ui;
        void setupGeneral();
    };
    What could be a reason?

  2. #2
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Move QTM_USE_NAMESPACE out of namespace Ui.

  3. #3
    Registered User vitalisam's Avatar
    Join Date
    Jul 2010
    Posts
    5
    Thanks! It helps

  4. #4
    Registered User flax1972's Avatar
    Join Date
    Dec 2009
    Posts
    6
    Hi,
    I was trying to compile my first application (battery level) using Nokia Qt SDK 1.1,
    when I got the same error 'ISO C++ forbids declaration of 'QSystemDeviceInfo' with no type..'

    Here the code in .h

    // checksum 0x9a77 version 0x20001
    /*
    This file was generated by the Mobile Qt Application wizard of Qt Creator.
    MainWindow is a convenience class containing mobile device specific code
    such as screen orientation handling.
    It is recommended not to modify this file, since newer versions of Qt Creator
    may offer an updated version of it.
    */

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H



    #include <QtGui/QMainWindow>
    #include <QSystemInfo>

    QTM_USE_NAMESPACE

    namespace Ui {
    class MainWindow;
    }

    class MainWindow : public QMainWindow
    {
    Q_OBJECT
    public:
    enum ScreenOrientation {
    ScreenOrientationLockPortrait,
    ScreenOrientationLockLandscape,
    ScreenOrientationAuto
    };

    explicit MainWindow(QWidget *parent = 0);
    virtual ~MainWindow();

    void setOrientation(ScreenOrientation orientation);
    void showExpanded();

    private:
    Ui::MainWindow *ui;
    void setupGeneral();
    QSystemDeviceInfo *deviceInfo;
    };

    #endif // MAINWINDOW_H


    Can anyone help me ?

    thnks in advance

  5. #5
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    How does your project file looks like?

  6. #6
    Registered User flax1972's Avatar
    Join Date
    Dec 2009
    Posts
    6
    here is the .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

    # Avoid auto screen rotation
    #DEFINES += ORIENTATIONLOCK

    # Needs to be defined for Symbian
    DEFINES += NETWORKACCESS

    symbian:TARGET.UID3 = 0xE1A897EA

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

    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()

    regards

  7. #7
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Verify that QSystemInfo exist
    Code:
    find ~/NokiaQtSDK/ -name "QSystemInfo"

  8. #8
    Registered User flax1972's Avatar
    Join Date
    Dec 2009
    Posts
    6
    naturally I missed to say OS is Windows XP SP2 and I have downloaded the package Qt_SDK_Win_offline_v1_1_TP_en
    This is the output of the command...looks dir is there

    C:\QtSDK>dir QSystemInfo /s
    Il volume nell'unità C non ha etichetta.
    Numero di serie del volume: 3CAE-2534

    Directory di C:\QtSDK\Maemo\4.6.2\sysroots\fremantle-arm-sysroot-20.2010.36-2-slim\usr\include\QtSystemInfo

    26/01/2011 14.34 25 QSystemInfo
    1 File 25 byte

    Directory di C:\QtSDK\Simulator\QtMobility\mingw\include\QtSystemInfo

    26/01/2011 14.42 33 QSystemInfo
    1 File 33 byte

    Directory di C:\QtSDK\Symbian\SDKs\Symbian1Qt471\epoc32\include\middleware

    26/01/2011 14.52 33 QSystemInfo
    1 File 33 byte

    Directory di C:\QtSDK\Symbian\SDKs\Symbian3Qt471\epoc32\include\mw

    26/01/2011 14.52 33 QSystemInfo
    1 File 33 byte

    Totale file elencati:
    4 File 124 byte
    0 Directory 1.511.854.080 byte disponibili


  9. #9
    Nokia Developer Expert lpotter's Avatar
    Join Date
    Jun 2008
    Location
    Brisbane, Australia
    Posts
    18
    The QtSDK does not have QtMobility for the desktop target. You will need to use the simulator or a device target.
    Code Monkey, QtMobility, Nokia

  10. #10
    Registered User flax1972's Avatar
    Join Date
    Dec 2009
    Posts
    6
    Hi,
    I followed step by step the Battery Indicator example:

    after installing QtSDK 1.1 on OS Win XP SP2 I created a Qt Mobile Application as shown in the examples Battery Indicator(with targets Simulator and Symbian 3 checked );

    the error I posted refers to Simulator target , below the full error stack:

    Starting: "C:\QtSDK\mingw\bin\mingw32-make.exe" -w
    mingw32-make: Entering directory `C:/Dev/BatteryIndicator-build-simulator'
    C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory `C:/Dev/BatteryIndicator-build-simulator'
    g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DNETWORKACCESS -DQT_DLL -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\QtSDK\Simulator\Qt\mingw\include\QtCore" -I"..\..\QtSDK\Simulator\Qt\mingw\include\QtNetwork" -I"..\..\QtSDK\Simulator\Qt\mingw\include\QtGui" -I"..\..\QtSDK\Simulator\Qt\mingw\include" -I"c:\QtSDK\Simulator\Qt\mingw\include\QtSystemInfo" -I"c:\QtSDK\Simulator\Qt\mingw\include\QtMobilitySimulator" -I"..\..\QtSDK\Simulator\QtMobility\mingw\include" -I"..\..\QtSDK\Simulator\QtMobility\mingw\include\QtMobility" -I"..\..\QtSDK\Simulator\QtMobility\mingw\include\QtSystemInfo" -I"..\..\QtSDK\Simulator\Qt\mingw\include\ActiveQt" -I"debug" -I"." -I"..\BatteryIndicator" -I"." -I"..\..\QtSDK\Simulator\Qt\mingw\mkspecs\win32-g++" -o debug\main.o ..\BatteryIndicator\main.cpp
    In file included from ..\BatteryIndicator\main.cpp:1:
    ..\BatteryIndicator\/mainwindow.h:43: error: ISO C++ forbids declaration of 'QSystemDeviceInfo' with no type
    ..\BatteryIndicator\/mainwindow.h:43: error: expected ';' before '*' token
    mingw32-make[1]: Leaving directory `C:/Dev/BatteryIndicator-build-simulator'
    mingw32-make: Leaving directory `C:/Dev/BatteryIndicator-build-simulator'
    mingw32-make[1]: *** [debug/main.o] Error 1
    mingw32-make: *** [debug] Error 2
    The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
    Error while building project BatteryIndicator (target: Qt Simulator)
    When executing build step 'Make'


    I tried on Symbian Device as target also (after installing Qt and Qt mobility) and the error is shown below:

    FAILED compile for arm.v5.udeb.gcce4_4_1: main.cpp
    mmp: BatteryIndicator_exe.mmp

    FAILED compile for arm.v5.udeb.gcce4_4_1: mainwindow.cpp
    mmp: BatteryIndicator_exe.mmp

    FAILED compile for arm.v5.udeb.gcce4_4_1: moc\moc_mainwindow.cpp
    mmp: BatteryIndicator_exe.mmp
    make[1]: *** [C:/QtSDK/Symbian/SDKs/Symbian3Qt471/epoc32/build/batteryindicator/c_15aee0cdff0fe883/batteryindicator_exe/armv5/udeb/main.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: *** [C:/QtSDK/Symbian/SDKs/Symbian3Qt471/epoc32/build/batteryindicator/c_15aee0cdff0fe883/batteryindicator_exe/armv5/udeb/mainwindow.o] Error 1
    make[1]: *** [C:/QtSDK/Symbian/SDKs/Symbian3Qt471/epoc32/build/batteryindicator/c_15aee0cdff0fe883/batteryindicator_exe/armv5/udeb/moc_mainwindow.o] Error 1
    sbs: error: The make-engine exited with errors.
    C:\QtSDK\Symbian\SDKs\Symbian3Qt471\epoc32\tools\make.exe: Leaving directory `C:/Dev/BatteryIndicator'
    C:\QtSDK\Symbian\SDKs\Symbian3Qt471\epoc32\tools\make.exe: *** [debug-gcce] Error 1
    The process "C:\QtSDK\Symbian\SDKs\Symbian3Qt471\epoc32\tools\make.exe" exited with code 2.
    Error while building project BatteryIndicator (target: Symbian Device)
    When executing build step 'Make'
    Is possible for you to reproduce the error ?

    Can you tell me if I'm making a mistake or is some problem in my environment or a bug of the package ?

    Regards

  11. #11
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    You should clean the project and run qmake after switching the targets.

  12. #12
    Registered User flax1972's Avatar
    Join Date
    Dec 2009
    Posts
    6
    After cleaning the project Im getting the following Compile out messages (could not find sm files):

    Impossibile trovare C:\Dev\BatteryIndicator-build-simulator\debug\moc_mainwindow.cpp
    Impossibile trovare C:\Dev\BatteryIndicator-build-simulator\debug\moc_mainwindow.cpp
    ....
    Impossibile trovare C:\Dev\BatteryIndicator-build-simulator\debug\main.o
    Impossibile trovare C:\Dev\BatteryIndicator-build-simulator\debug\main.o
    ......
    Impossibile trovare C:\Dev\BatteryIndicator-build-simulator\release\moc_mainwindow.cpp
    Impossibile trovare C:\Dev\BatteryIndicator-build-simulator\release\moc_mainwindow.cpp

    Impossibile trovare C:\Dev\BatteryIndicator-build-simulator\ui_mainwindow.h
    Impossibile trovare C:\Dev\BatteryIndicator-build-simulator\ui_mainwindow.h
    .......
    Impossibile trovare C:\Dev\BatteryIndicator-build-simulator\release\main.o
    Impossibile trovare C:\Dev\BatteryIndicator-build-simulator\release\main.o
    ...
    In file included from ..\BatteryIndicator\main.cpp:1:
    In file included from ..\BatteryIndicator\main.cpp:1:
    ..\BatteryIndicator\/mainwindow.h:43: error: ISO C++ forbids declaration of 'QSystemDeviceInfo' with no type
    ..\BatteryIndicator\/mainwindow.h:43: error: ISO C++ forbids declaration of 'QSystemDeviceInfo' with no type
    ..\BatteryIndicator\/mainwindow.h:43: error: expected ';' before '*' token
    ..\BatteryIndicator\/mainwindow.h:43: error: expected ';' before '*' token

    and after run qmake

    Running build steps for project BatteryIndicator...
    Starting: "c:\qtsdk\simulator\qt\mingw\bin\qmake.exe" C:\Dev\BatteryIndicator\BatteryIndicator.pro -r -spec win32-g++ QMLJSDEBUGGER_PATH=C:/QtSDK/QtCreator/share/qtcreator/qml/qmljsdebugger
    WARNING: c:\QtSDK\Simulator\Qt\mingw\mkspecs\features\mobility.prf:1: Unescaped backslashes are deprecated.
    WARNING: c:\QtSDK\Simulator\Qt\mingw\mkspecs\features\mobility.prf:1: Unescaped backslashes are deprecated.
    WARNING: c:\QtSDK\Simulator\Qt\mingw\mkspecs\features\mobility.prf:1: Unescaped backslashes are deprecated.
    The process "c:\qtsdk\simulator\qt\mingw\bin\qmake.exe" exited normally.


    The error is still there. Have any suggestions ?

  13. #13
    Registered User sassi67's Avatar
    Join Date
    Feb 2011
    Posts
    1
    The same problem with the same example under Vista Home premium 64bit SP2 with Nokia QT SDK 1.1 TP.

    Target is "Qt Simulator" and the project file is:

    QT += core gui

    TARGET = BatteryIndicator
    TEMPLATE = app


    SOURCES += main.cpp\
    batteryindicator.cpp

    HEADERS += batteryindicator.h

    FORMS += batteryindicator.ui

    CONFIG += mobility
    MOBILITY += systeminfo

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

  14. #14
    Nokia Developer Champion danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    Code:
    ..\BatteryIndicator\/mainwindow.h:43: error: ISO C++ forbids declaration of 'QSystemDeviceInfo' with no type
    ..\BatteryIndicator\/mainwindow.h:43: error: ISO C++ forbids declaration of 'QSystemDeviceInfo' with no type
    ..\BatteryIndicator\/mainwindow.h:43: error: expected ';' before '*' token
    ..\BatteryIndicator\/mainwindow.h:43: error: expected ';' before '*' token
    I'd look at whatever is just before line 43 in mainwindow.h. There may be a syntax error there, either in mainwindow.h directly, or in another included file.

    And sometimes the problem is in the file that includes, eg, mainwindow.h, or in some include ahead of it.

    A missing ";" at the end of a class declaration is a common problem.

  15. #15
    Registered User flax1972's Avatar
    Join Date
    Dec 2009
    Posts
    6
    This is th mainwindow.h


    // checksum 0x9a77 version 0x20001
    /*
    This file was generated by the Mobile Qt Application wizard of Qt Creator.
    MainWindow is a convenience class containing mobile device specific code
    such as screen orientation handling.
    It is recommended not to modify this file, since newer versions of Qt Creator
    may offer an updated version of it.
    */

    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H

    #include <QtGui/QMainWindow>

    #include <QSystemInfo>

    QTM_USE_NAMESPACE

    namespace Ui {
    class MainWindow;
    }

    class MainWindow : public QMainWindow
    {
    Q_OBJECT
    public:
    enum ScreenOrientation {
    ScreenOrientationLockPortrait,
    ScreenOrientationLockLandscape,
    ScreenOrientationAuto
    };

    explicit MainWindow(QWidget *parent = 0);
    virtual ~MainWindow();

    void setOrientation(ScreenOrientation orientation);
    void showExpanded();

    private:
    Ui::MainWindow *ui;
    void setupGeneral();
    QSystemDeviceInfo *deviceInfo;
    };

    #endif // MAINWINDOW_H

    I think this problem is related to the declaration of the nemaspace QTM_USE_NAMESPACE

    I got the same problem on develope env Linux also.

    May be this release may have a problem.

Page 1 of 2 12 LastLast

Similar Threads

  1. Develop for symbian using Qt sdk beta on linux
    By jerr0 in forum [Archived] Qt SDKs and Tools
    Replies: 3
    Last Post: 2010-07-26, 20:12
  2. Develop for symbian using Qt sdk beta on linux
    By jerr0 in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2010-05-15, 02:06
  3. Qt for Maemo and Qt for embedde Linux
    By Estel in forum Nokia N9
    Replies: 2
    Last Post: 2010-03-21, 21:34
  4. GCCE compile error: ISO C++ forbids declaration of `RAttributeArray' with no type
    By liuxingyu_best in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2008-07-05, 18:07
  5. Nokia 6131 NFC and ISO 14443 type B
    By alagger in forum Near Field Communication
    Replies: 3
    Last Post: 2007-05-29, 09:25

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