Hello everyone

I'm new to qt embedded, and I got a problem when I use Qt Creator to cross compile my beaglebone black.

Host PC:
Qt Code:
  1. albert@YL-Probook:~$ uname -a
  2. Linux YL-Probook 3.8.0-35-generic #50~precise1-Ubuntu SMP Wed Dec 4 17:25:51 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
To copy to clipboard, switch view to plain text mode 

Qt Creator 3.0.0
Based on Qt 5.2.0 (GCC 4.6.1, 64 bit)

Built on Dec 10 2013 at 11:45:55

From revision 27d10d8dcd

Copyright 2008-2013 Digia Plc. All rights reserved.


target:

Qt Code:
  1. ubuntu@arm:~$ uname -a
  2. Linux arm 3.8.13-bone32 #1 SMP Fri Dec 13 20:05:25 UTC 2013 armv71 armv71 armv71 GNU/Linux
To copy to clipboard, switch view to plain text mode 
First, I built the qt source. I followed the following steps:
1.
Qt Code:
  1. sudo apt-get install arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++
To copy to clipboard, switch view to plain text mode 
2. Download qt-everywher-opensource-src-4.8.5.tar.gz and extract this to /home/albert/ToolChain
3. Modify qmake.conf in /home/albert/ToolChain/qt-everywher-opensource-src-4.8.5/mkspecs/qws/linux-arm-g++,

Qt Code:
  1. #
  2. # qmake configuration for building with arm-linux-g++
  3. #
  4.  
  5. include(../../common/linux.conf)
  6. include(../../common/gcc-base-unix.conf)
  7. include(../../common/g++-unix.conf)
  8. include(../../common/qws.conf)
  9.  
  10. # modifications to g++.conf
  11. QMAKE_CC = arm-linux-gnueabihf-gcc
  12. QMAKE_CXX = arm-linux-gnueabihf-g++
  13. QMAKE_LINK = arm-linux-gnueabihf-g++
  14. QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++
  15.  
  16. # modifications to linux.conf
  17. QMAKE_AR = arm-linux-gnueabihf-ar cqs
  18. QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy
  19. QMAKE_STRIP = arm-linux-gnueabihf-strip
  20.  
  21. load(qt_config)
To copy to clipboard, switch view to plain text mode 

4. Return to /home/albert/ToolChain/qt-everywher-opensource-src-4.8.5
5.
Qt Code:
  1. ./configure -prefix /home/albert/ToolChain/qt-arm -embedded arm -host-little-endian -no-cups -no-pch -no-3dnow -nomake examples -nomake demos -nomake docs -xplatform /qws/linux-arm-g++
To copy to clipboard, switch view to plain text mode 
6.
Qt Code:
  1. make
To copy to clipboard, switch view to plain text mode 
7.
Qt Code:
  1. make install
To copy to clipboard, switch view to plain text mode 
8. Configure environment variables:
Qt Code:
  1. export ARMQTDIR=/home/albert/ToolChain/qt-arm
  2. export PATH=$ARMQTDIR/bin:$PATH
  3. export MANPATH=$ARMQTDIR/man:$MANPATH
  4. export LD_LIBRARY_PATH=$ARMQTDIR/lib:$LD_LIBRARY_PATH
  5. export QMAKESPEC=/home/albert/ToolChain/qt-arm/mkspecs/qws/linux-arm-g++
To copy to clipboard, switch view to plain text mode 

Until now, there is no error. Also, I tested qmake -v and which qmake, they all can output correct results.

Now, I configured the qt creator.
1. Adding version: Qt version 4.8.5 for Embedded Linux
2. Adding compiler: /usr/bin/arm-linux-gnueabihf-gcc
3. Adding debugger: /usr/bin/gdb
4. Adding Kits

Until now, there is also no error.

Then, I create a widget project and choose this cross compiler. I didn't modify any code at all and I tried to build this project, it shows the following error:

22:37:22: Running steps for project analogclock...
22:37:22: Starting: "/home/albert/ToolChain/qt-arm/bin/qmake" /home/albert/Qt5.2.0/5.2.0/gcc_64/examples/gui/analogclock/analogclock.pro -r -spec /qws/linux-arm-g++ CONFIG+=declarative_debug
Failure to read QMAKESPEC conf file /qws/linux-arm-g++/qmake.conf.
Error processing project file: /home/albert/Qt5.2.0/5.2.0/gcc_64/examples/gui/analogclock/analogclock.pro
22:37:22: The process "/home/albert/ToolChain/qt-arm/bin/qmake" exited with code 3.
Error while building/deploying project analogclock (kit: arm-linux-gnueabihf)
When executing step 'qmake'
22:37:22: Elapsed time: 00:00.

I also realized that when I use cross compiler, there is something strange happened to the project navigation window. Only project name shows in the window, all the source files, include files and config files are missing.

I checked the QMAKESPEC in terminal, it shows
Qt Code:
  1. albert@YL-Probook:~$ echo $QMAKESPEC
  2. /home/albert/ToolChain/qt-arm/qws/linux-arm-g++
To copy to clipboard, switch view to plain text mode 

So, the QMAKESPEC is actually there and the qmake.conf file also exists. I can't understand why this error keep showing. Can anyone help me? Thanks.