QtMobility header not found on Mac OS X



  • Hello. I am trying to install QtMobility on Mac OS X. I need only the systeminfo module, so I do the following:

    ./configure -modules systeminfo -prefix /usr/local/QtMobility
    make
    make install

    I see QtSystemInfo.framework installed, but when I try to build quickstart sample, it can't find QSystemInfo header. Also I see Xcode doesn't add QtSystemInfo.framework to the project. Even if I drag it manually, it is shown in red color like a missing file. Installation guide tells I have to expand LD_LIBRARY_PATH variable, so I tried to add the following to /etc/profile:

    LD_LIBRARY_PATH=/usr/local/QtMobility/lib:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH

    Also tried to expand DYLD_LIBRARY_PATH instead. Nothing works.

    I've tried it on different Mac OS X versions (10.6 and 10.7) with no success. What should I do in order to make QtMobility available for my projects?



  • Have you tried using Qt Creator? According to "Qt Mobility 1.2.2 documentation XCode is not supported":http://doc.qt.digia.com/qtmobility/installation.html:

    bq. Note: QtMobility currently has no support for building with Xcode.



  • I have tried to build it from the command line:
    qmake -spec macx-g++ quickstart.pro
    make

    It fails with the same error. I will try Qt Creator, but I scarcely believe it depends on IDE. As far as I understand, they meant building QtMobility framework with Xcode is not supported - I don't do that. Xcode is used to build a project that uses QtSystemInfo.framework.



  • [quote author="mentalmushroom" date="1364375013"]I have tried to build it from the command line:
    qmake -spec macx-g++ quickstart.pro
    make
    [/quote]

    Could you please post the whole error log?



  • bash-3.2$ qmake -spec macx-g++ quickstart.pro
    bash-3.2$ make
    g++ -c -pipe -g -gdwarf-2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.8/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtNetwork.framework/Versions/4/Headers -I/usr/include/QtNetwork -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I. -I. -F/Library/Frameworks -o main.o main.cpp
    main.cpp:45:29: error: QSystemInfo: No such file or directory
    main.cpp:49: error: expected constructor, destructor, or type conversion before ‘int’
    make: *** [main.o] Error 1
    bash-3.2$



  • Please make sure that your pro file includes the following configuration:

    @
    CONFIG += mobility
    MOBILITY = systeminfo
    @

    And specify Qt Mobility namespace:
    @
    #include <QSystemInfo>

    QTM_USE_NAMESPACE
    @

    If this doesn't then most probably Qt Mobility is not installed successfully. You can check other threads in "Qt Project's forum for similar issues and hints for settings DYLD_LIBRARY_PATH on Mac OS":http://qt-project.org/forums/viewthread/3064/



  • Yes, it does include

    @CONFIG += mobility

    MOBILITY = systeminfo@

    Moreover, it is a sample project shipped along with QtMobility that shows the proper basic usage of QtMobility framework.

    I didn't see any error messages while installing QtMobility. Only while configuring it failed to find something, but it didn't seem to be needed for systeminfo module, so it succeeded to build. I have it installed in the desired location, only it is not visible to my project. I see LD_LIBRARY_PATH and DYLD_LIBRARY_PATH extend the library paths, but my issue is about headers. So I need to find a way to make headers available. Documentation simply keeps silence about it :(


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.