首页 > 解决方案 > 为 ARM 板交叉编译 QT,配置失败

问题描述

我下载qt-everywhere-opensource-src-5.6.0.tar.gz并修改/qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf

#
# qmake configuration for building with arm-linux-gnueabi-g++
#

MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

QT_QPA_DEFAULT_PLATFORM = linuxfb
QMAKE_CFLAGS += -msoft-float -D__GCC_FLOAT_NOT_NEEDED -march=armv4t -mtune=arm920t
QMAKE_CXXFLAGS += -msoft-float -D__GCC_FLOAT_NOT_NEEDED -march=armv4t -mtune=arm920t

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

QMAKE_INCDIR += /usr/local/tslib/include
QMAKE_LIBDIR += /usr/local/tslib/lib

# modifications to g++.conf
QMAKE_CC         = arm-none-linux-gnueabi-gcc -lts
QMAKE_CXX        = arm-none-linux-gnueabi-g++ -lts
QMAKE_LINK       = arm-none-linux-gnueabi-g++ -lts
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++ -lts

# modifications to linux.conf
QMAKE_AR      = arm-none-linux-gnueabi-ar cqs 
QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy 
QMAKE_NM      = arm-none-linux-gnueabi-nm -P
QMAKE_STRIP   = arm-none-linux-gnueabi-strip
load(qt_config)

然后我配置(-xplatform linux-arm-gnueabi-g++将使用qmake.conf目录)

sudo ./configure -prefix /usr/local/Qt5.6 \
-opensource \
-release \
-confirm-license \
-xplatform linux-arm-gnueabi-g++ \
-shared \
-qt-zlib \
-no-gif \
-qt-libjpeg \
-no-nis \
-no-opengl \
-no-cups \
-no-glib \
-no-dbus \
-no-rpath \
-no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 \
-no-avx \
-no-openssl \
-nomake tools \
-qreal float \
-qt-libpng \
-tslib \
-nomake examples

但是配置失败,它输出如下

+ cd qtbase
+ /work/QT/qt-everywhere-opensource-src-5.6.0/qtbase/configure -top-level -prefix /usr/local/Qt5.6 -opensource -release -confirm-license -xplatform linux-arm-gnueabi-g++ -shared -qt-zlib -no-gif -qt-libjpeg -no-nis -no-opengl -no-cups -no-glib -no-dbus -no-rpath -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-openssl -nomake tools -qreal float -qt-libpng -tslib -nomake examples

This is the Qt Open Source Edition.

You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
You are also licensed to use this software under the terms of
the GNU Lesser General Public License (LGPL) versions 3.

You have already accepted the terms of the Open Source license.

Running configuration tests (phase 1)...
Done running configuration tests.
Creating qmake...
make: g++: Command not found
make: *** [project.o] Error 127

为什么它由g++而不是arm-none-linux-gnueabi-g++

标签: linuxqtgcc

解决方案


推荐阅读