PDA

View Full Version : QtCreator and cross-compiling



zuck
27th April 2009, 16:34
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:


-spec /usr/local/Trolltech/QtEmbedded-4.5.0-arm/mkspecs/qws/linux-armv6-g++

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

This is my command line for g++:


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
-I/usr/local/Trolltech/QtEmbedded-4.5.0-arm/mkspecs/qws/linux-armv6-g++
-I.
-I/usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtCore
-I/usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtNetwork
-I/usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtDBus
-I/usr/local/Trolltech/QtEmbedded-4.5.0-arm/include
-I../../core/pkserver
-I.
-I.
-o pkpowermanager.o pkpowermanager.cpp

..but the result is:



In file included from /usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtCore/qstring.h:46,
from /usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtCore/qobject.h:48,
from /usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtCore/qplugin.h:45,
from /usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtCore/QtPlugin:1,
from ../../core/pkserver/pkapplication.h:17,
from pkpowermanager.h:17,
from pkpowermanager.cpp:14:
/usr/local/Trolltech/QtEmbedded-4.5.0-arm/include/QtCore/qbytearray.h:48:20: error: string.h: No file or directory

:confused:

wysota
28th April 2009, 20:04
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.