Results 1 to 2 of 2

Thread: QtCreator and cross-compiling

  1. #1
    Join Date
    Mar 2009
    Posts
    72
    Thanks
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QtCreator and cross-compiling

    Hi, I need to cross-compile a Qt project for ARM processors.

    I'm using QtCreator and I want to manage the build process from this IDE. I've already cross-compiled gcc, g++ and Qt-Embedded-4.5.0 for ARM.

    Now I want to build my project. These are the steps I've already done:

    1) Add a new build settings entry (Debug - ARM).
    2) Select Qt-Embedded-4.5.0-arm as Qt library version.
    3) Add Qt-Embedded-4.5.0-arm and gcc/g++-arm bin paths to my PATH environment variable.
    4) Specify a custom command line for QMake:

    Qt Code:
    1. -spec /usr/local/Trolltech/QtEmbedded-4.5.0-arm/mkspecs/qws/linux-armv6-g++
    To copy to clipboard, switch view to plain text mode 

    5) Select "Clean project", "Run qmake" and "Build project" options from project context menu.

    This is my command line for g++:

    Qt Code:
    1. arm-linux-g++ -c -pipe -march=armv6 -g -Wall -W -D_REENTRANT -fPIC -DQT_PLUGIN -DQT_DBUS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
    2. -I/usr/local/Trolltech/QtEmbedded-4.5.0-arm/mkspecs/qws/linux-armv6-g++
    3. -I.
    4. -I/usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtCore
    5. -I/usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtNetwork
    6. -I/usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtDBus
    7. -I/usr/local/Trolltech/QtEmbedded-4.5.0-arm/include
    8. -I../../core/pkserver
    9. -I.
    10. -I.
    11. -o pkpowermanager.o pkpowermanager.cpp
    To copy to clipboard, switch view to plain text mode 

    ..but the result is:

    Qt Code:
    1. In file included from /usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtCore/qstring.h:46,
    2. from /usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtCore/qobject.h:48,
    3. from /usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtCore/qplugin.h:45,
    4. from /usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtCore/QtPlugin:1,
    5. from ../../core/pkserver/pkapplication.h:17,
    6. from pkpowermanager.h:17,
    7. from pkpowermanager.cpp:14:
    8. /usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtCore/qbytearray.h:48:20: error: string.h: No file or directory
    To copy to clipboard, switch view to plain text mode 


  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QtCreator and cross-compiling

    Do you have /usr/include in your includepath? It's possible you need to have a separate /usr/include branch for your arm cross-compiler and point the compiler to look for includes there.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.