我正在尝试(并且失败)将qt 5.5交叉编译到VM构建服务器中的beaglebone。 服务器正在运行Debian 8。
我正在使用的工具链是Linaro Toolchain来编译到Beaglebone
然后我运行此命令在Qt qmake文件中设置工具链路径:
cp -r qtbase/mkspecs/devices/linux-beagleboard-g++ qtbase/mkspecs/devices/linux-beaglebone-g++.old
sed -i -e 's|-mfloat-abi=softfp|-mfloat-abi=hard|g' qtbase/mkspecs/devices/linux-beagleboard-g++/qmake.conf
cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/linux-arm-gnueabi-g++.old
sed -i -E -e 's|arm-linux-gnueabi-(.*)|/home/user/Desktop/tools/linaro/linaro-4.8/bin/arm-linux-gnueabihf-\1|g' qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf
然后我使用此命令构建qt源:
./configure -v -static -release -optimized-qmake -reduce-exports -no-pch -platform linux-g++ -xplatform linux-linaro-gnueabihf-g++ -device linux-beagleboard-g++ -device-option CROSS_COMPILE=/home/user/Desktop/tools/linaro/linaro-4.8/bin/arm-linux-gnueabihf- -prefix ./static/ -opensource -confirm-license -no-largefile -no-sql-mysql -no-sql-psql -qt-sql-sqlite -no-journald -qt-zlib -no-mtdev -no-icu -no-gif -qt-libpng -qt-libjpeg -qt-freetype -qt-harfbuzz -openssl-linked -qt-pcre -no-xcb -no-xinput2 -no-glib -no-egl -no-xcursor -no-xfixes -no-xrandr -no-xinerama -no-xinput -qt-xkbcommon-x11 -no-pulseaudio -no-alsa -no-gtkstyle -no-compile-examples -no-nis -no-cups -no-iconv -no-tslib -fontconfig -no-dbus -no-xcb-xlib -no-eglfs -no-directfb -no-linuxfb -no-kms -no-opengl -no-gstreamer -nomake examples -nomake tests -skip qtwebkit -skip qtwebsockets -skip qtwebkit-examples -skip qtwebchannel -skip qtwebengine -skip qtwayland -skip qtwinextras -skip qtsvg -skip qtsensors -skip qtcanvas3d -skip qtconnectivity -skip declarative -skip multimedia -skip quick1 -no-audio-backend -no-xkbcommon-evdev -no-evdev -no-libproxy -I/home/tools/openssl/arm/openssl-1.0.1p/include -L/home/tools/openssl/arm/openssl-1.0.1p/ -lssl -lcrypto
make -k -j4
make -k install
我对交叉编译过程比较陌生,而且我很难搞清楚可能出现的问题。 我在这里上传了qt configure命令输出:Pastebin URL。
任何有更多经验的人都可以看看,看看可能会遗漏什么?
我收到了类似这样的错误:
g++ -c -pipe -O2 -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_QMLDEVTOOLS_LIB -DQDOC2_COMPAT -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_BOOTSTRAP_LIB -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -DQT_NO_TRANSLATION -I. -I/home/tools/openssl/arm/openssl-1.0.1p/include -I. -Iqmlparser -I../../../include -I../../../include/QtCore -I../../../include/QtXml -I../../../include/QtCore/5.5.0 -I../../../include/QtCore/5.5.0/QtCore -I../../../include/QtXml/5.5.0 -I../../../include/QtXml/5.5.0/QtXml -I../../../mkspecs/linux-g++ -o .obj/editdistance.o editdistance.cpp
In file included from ../../include/QtCore/qbytearray.h:1:0,
from ../../include/QtCore/../../src/corelib/tools/qstring.h:42,
from ../../include/QtCore/qstring.h:1,
from global/qglobal.cpp:36:
../../include/QtCore/../../src/corelib/tools/qbytearray.h:260:26: error: expected ‘;’ at end of member declaration
QByteArray toLower() const & Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:261:5: error: expected unqualified-id before ‘{’ token
{ return toLower_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:261:37: error: expected ‘;’ at end of member declaration
{ return toLower_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:262:24: error: expected ‘;’ at end of member declaration
QByteArray toLower() && Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:263:5: error: expected unqualified-id before ‘{’ token
{ return toLower_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:263:37: error: expected ‘;’ at end of member declaration
{ return toLower_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:264:26: error: expected ‘;’ at end of member declaration
QByteArray toUpper() const & Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:265:5: error: expected unqualified-id before ‘{’ token
{ return toUpper_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:265:37: error: expected ‘;’ at end of member declaration
{ return toUpper_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:266:24: error: expected ‘;’ at end of member declaration
QByteArray toUpper() && Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:267:5: error: expected unqualified-id before ‘{’ token
{ return toUpper_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:267:37: error: expected ‘;’ at end of member declaration
{ return toUpper_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:268:26: error: expected ‘;’ at end of member declaration
QByteArray trimmed() const & Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:269:5: error: expected unqualified-id before ‘{’ token
{ return trimmed_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:269:37: error: expected ‘;’ at end of member declaration
{ return trimmed_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:270:24: error: expected ‘;’ at end of member declaration
QByteArray trimmed() && Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:271:5: error: expected unqualified-id before ‘{’ token
{ return trimmed_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:271:37: error: expected ‘;’ at end of member declaration
{ return trimmed_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:272:29: error: expected ‘;’ at end of member declaration
QByteArray simplified() const & Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:273:5: error: expected unqualified-id before ‘{’ token
{ return simplified_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:273:40: error: expected ‘;’ at end of member declaration
{ return simplified_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:274:27: error: expected ‘;’ at end of member declaration
QByteArray simplified() && Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:275:5: error: expected unqualified-id before ‘{’ token
{ return simplified_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qbytearray.h:275:40: error: expected ‘;’ at end of member declaration
{ return simplified_helper(*this); }
^
In file included from ../../include/QtCore/qstring.h:1:0,
from global/qglobal.cpp:36:
../../include/QtCore/../../src/corelib/tools/qstring.h:388:23: error: expected ‘;’ at end of member declaration
QString toLower() const & Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:389:5: error: expected unqualified-id before ‘{’ token
{ return toLower_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:389:37: error: expected ‘;’ at end of member declaration
{ return toLower_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:390:21: error: expected ‘;’ at end of member declaration
QString toLower() && Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:391:5: error: expected unqualified-id before ‘{’ token
{ return toLower_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:391:37: error: expected ‘;’ at end of member declaration
{ return toLower_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:392:23: error: expected ‘;’ at end of member declaration
QString toUpper() const & Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:393:5: error: expected unqualified-id before ‘{’ token
{ return toUpper_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:393:37: error: expected ‘;’ at end of member declaration
{ return toUpper_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:394:21: error: expected ‘;’ at end of member declaration
QString toUpper() && Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:395:5: error: expected unqualified-id before ‘{’ token
{ return toUpper_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:395:37: error: expected ‘;’ at end of member declaration
{ return toUpper_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:396:28: error: expected ‘;’ at end of member declaration
QString toCaseFolded() const & Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:397:5: error: expected unqualified-id before ‘{’ token
{ return toCaseFolded_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:397:42: error: expected ‘;’ at end of member declaration
{ return toCaseFolded_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:398:26: error: expected ‘;’ at end of member declaration
QString toCaseFolded() && Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:399:5: error: expected unqualified-id before ‘{’ token
{ return toCaseFolded_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:399:42: error: expected ‘;’ at end of member declaration
{ return toCaseFolded_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:400:23: error: expected ‘;’ at end of member declaration
QString trimmed() const & Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:401:5: error: expected unqualified-id before ‘{’ token
{ return trimmed_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:401:37: error: expected ‘;’ at end of member declaration
{ return trimmed_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:402:21: error: expected ‘;’ at end of member declaration
QString trimmed() && Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:403:5: error: expected unqualified-id before ‘{’ token
{ return trimmed_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:403:37: error: expected ‘;’ at end of member declaration
{ return trimmed_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:404:26: error: expected ‘;’ at end of member declaration
QString simplified() const & Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:405:5: error: expected unqualified-id before ‘{’ token
{ return simplified_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:405:40: error: expected ‘;’ at end of member declaration
{ return simplified_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:406:24: error: expected ‘;’ at end of member declaration
QString simplified() && Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:407:5: error: expected unqualified-id before ‘{’ token
{ return simplified_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:407:40: error: expected ‘;’ at end of member declaration
{ return simplified_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:503:27: error: expected ‘;’ at end of member declaration
QByteArray toLatin1() const & Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:504:5: error: expected unqualified-id before ‘{’ token
{ return toLatin1_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:504:38: error: expected ‘;’ at end of member declaration
{ return toLatin1_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:505:25: error: expected ‘;’ at end of member declaration
QByteArray toLatin1() && Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:506:5: error: expected unqualified-id before ‘{’ token
{ return toLatin1_helper_inplace(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:506:46: error: expected ‘;’ at end of member declaration
{ return toLatin1_helper_inplace(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:507:25: error: expected ‘;’ at end of member declaration
QByteArray toUtf8() const & Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:508:5: error: expected unqualified-id before ‘{’ token
{ return toUtf8_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:508:36: error: expected ‘;’ at end of member declaration
{ return toUtf8_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:509:23: error: expected ‘;’ at end of member declaration
QByteArray toUtf8() && Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:510:5: error: expected unqualified-id before ‘{’ token
{ return toUtf8_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:510:36: error: expected ‘;’ at end of member declaration
{ return toUtf8_helper(*this); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:511:30: error: expected ‘;’ at end of member declaration
QByteArray toLocal8Bit() const & Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:512:5: error: expected unqualified-id before ‘{’ token
{ return toLocal8Bit_helper(constData(), size()); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:512:55: error: expected ‘;’ at end of member declaration
{ return toLocal8Bit_helper(constData(), size()); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:513:28: error: expected ‘;’ at end of member declaration
QByteArray toLocal8Bit() && Q_REQUIRED_RESULT
^
../../include/QtCore/../../src/corelib/tools/qstring.h:514:5: error: expected unqualified-id before ‘{’ token
{ return toLocal8Bit_helper(constData(), size()); }
^
../../include/QtCore/../../src/corelib/tools/qstring.h:514:55: error: expected ‘;’ at end of member declaration
{ return toLocal8Bit_helper(constData(), size()); }