当arm-linux-g++或者arm-linux-gcc不能用时,只需要把qmake执行文件中定义的编译器名称改成电脑中已安装的版本,下面是我安装的版本,仅供参考。
首先 找到我的安装目录 我的路径是usr/local/arm/qt4.8.5/mkspecs/qws/linux-arm-g++/qmake.conf
然后用vim打开 修改里边的参数。如下:
详细步骤如下:
abc123@ubuntu:~$ sudo su
[sudo] password for abc123:
root@ubuntu:/home/abc123# cd
root@ubuntu:~# cd /usr/local
root@ubuntu:/usr/local# ls
arm bin etc games include lib man sbin share src
root@ubuntu:/usr/local# cd arm
root@ubuntu:/usr/local/arm# ls
cross cross-tools-am335x-4.5.3.tar.bz2 qt4.8.5 qt4.8.5-sdk.tar.bz tslib
root@ubuntu:/usr/local/arm# cd qt4.8.5
root@ubuntu:/usr/local/arm/qt4.8.5# ls
bin examples include mkspecs tests
demos imports lib plugins translations
root@ubuntu:/usr/local/arm/qt4.8.5# cd mkspecs
root@ubuntu:/usr/local/arm/qt4.8.5/mkspecs# ls
aix-g++ qconfig.pri
aix-g++-64 qdevice.pri
aix-xlc qnx-armv7le-qcc
aix-xlc-64 qnx-x86-qcc
blackberry-armv7le-qcc qws
blackberry-playbook-armv7le-qcc sco-cc
blackberry-playbook-x86-qcc sco-g++
blackberry-x86-qcc solaris-cc
common solaris-cc-64
cygwin-g++ solaris-cc-64-stlport
darwin-g++ solaris-cc-stlport
default solaris-g++
features solaris-g++-64
freebsd-g++ symbian-abld
freebsd-g++46 symbian-armcc
freebsd-icc symbian-gcce
hpux-acc symbian-sbsv2
hpux-acc-64 tru64-cxx
hpux-acc-o64 tru64-g++
hpux-g++ unixware-cc
hpux-g++-64 unixware-g++
hpuxi-acc-32 unsupported
hpuxi-acc-64 win32-borland
hpuxi-g++-64 win32-g++
hurd-g++ win32-g++-4.6
irix-cc win32-icc
irix-cc-64 win32-msvc2003
irix-g++ win32-msvc2005
irix-g++-64 win32-msvc2008
linux-arm-gnueabi-g++ win32-msvc2010
linux-cxx win32-msvc2012
linux-ecc-64 wince50standard-armv4i-msvc2005
linux-g++ wince50standard-armv4i-msvc2008
linux-g++-32 wince50standard-mipsii-msvc2005
linux-g++-64 wince50standard-mipsii-msvc2008
linux-g++-maemo wince50standard-mipsiv-msvc2005
linux-icc wince50standard-mipsiv-msvc2008
linux-icc-32 wince50standard-sh4-msvc2005
linux-icc-64 wince50standard-sh4-msvc2008
linux-kcc wince50standard-x86-msvc2005
linux-llvm wince50standard-x86-msvc2008
linux-lsb-g++ wince60standard-armv4i-msvc2005
linux-pgcc wince60standard-x86-msvc2005
lynxos-g++ wince70embedded-armv4i-msvc2008
macx-g++ wince70embedded-x86-msvc2008
macx-g++40 wincewm50pocket-msvc2005
macx-g++42 wincewm50pocket-msvc2008
macx-icc wincewm50smart-msvc2005
macx-llvm wincewm50smart-msvc2008
macx-pbuilder wincewm60professional-msvc2005
macx-xcode wincewm60professional-msvc2008
macx-xlc wincewm60standard-msvc2005
modules wincewm60standard-msvc2008
netbsd-g++ wincewm65professional-msvc2005
openbsd-g++ wincewm65professional-msvc2008
root@ubuntu:/usr/local/arm/qt4.8.5/mkspecs# cd qws
root@ubuntu:/usr/local/arm/qt4.8.5/mkspecs/qws# ls
freebsd-generic-g++ linux-generic-g++ linux-x86-g++
integrity-arm-cxarm linux-generic-g++-32 linux-zylonite-g++
integrity-ppc-cxppc linux-ipaq-g++ macx-generic-g++
integrity-x86-cx86 linux-lsb-g++ macx-nacl-g++
linux-arm-g++ linux-mips-g++ qnx-arm-g++
linux-arm-gnueabi-g++ linux-nacl-g++ qnx-armv7-g++
linux-armv6-g++ linux-powerpc-g++ qnx-generic-g++
linux-avr32-g++ linux-sh4al-g++ qnx-i386-g++
linux-cellon-g++ linux-sharp-g++ qnx-ppc-g++
linux-dm7000-g++ linux-sh-g++ solaris-generic-g++
linux-dm800-g++ linux-x86_64-g++
root@ubuntu:/usr/local/arm/qt4.8.5/mkspecs/qws# cd linux-arm-g++
root@ubuntu:/usr/local/arm/qt4.8.5/mkspecs/qws/linux-arm-g++# ls
qmake.conf qmake.conf~ qplatformdefs.h
root@ubuntu:/usr/local/arm/qt4.8.5/mkspecs/qws/linux-arm-g++# vim qmake.confg
root@ubuntu:/usr/local/arm/qt4.8.5/mkspecs/qws/linux-arm-g++# vim qmake.conf
root@ubuntu:/usr/local/arm/qt4.8.5/mkspecs/qws/linux-arm-g++#
这样就OK了