Qt5.5.1 arm board的交叉编译:搞错了

时间:2017-06-11 13:47:58

标签: qt ubuntu arm

这些天,我想在我的扶手板上建立Qt环境,但我遇到了一些问题。详情如下。   首先,我交叉编译tslib:

lmk@lmk-virtual-machine:/home/newdisk$ sudo tar -zvxf tslib-1.4.tar.gz
lmk@lmk-virtual-machine:/home/newdisk$ cd tslib
lmk@lmk-virtual-machine:/home/newdisk/tslib$ ./autogen.sh 
lmk@lmk-virtual-machine:/home/newdisk/tslib$ ./configure --host=arm-linux --prefix=/home/newdisk/optnew/tslib ac_cv_func_malloc_0_nonnull=yes
lmk@lmk-virtual-machine:/home/newdisk/tslib$ make 
lmk@lmk-virtual-machine:/home/newdisk/tslib$ sudo make install

接下来,我交叉编译Qt src代码:

一个。新的autoconfig.sh

lmk@lmk-virtual-machine:/home/newdisk/qt-everywhere-opensource-src-5.5.1$ sudo vi autoconfig.sh

#autoconfig.sh
#!/bin/sh
./configure \
-v \
-prefix /home/newdisk/optnew/qt5.5.1 \
-release \
-opensource \
-make libs \
-xplatform linux-arm-gnueabi-g++ \
-optimized-qmake \
-pch \
-qreal float \
-qt-sql-sqlite \
-qt-libjpeg \
-qt-zlib \
-no-opengl \
-no-iconv \
-nomake examples \
-nomake tools \
-nomake tests \
-skip qt3d \
-skip qtcanvas3d \
-I/home/newdisk/optnew/tslib/include \
-L/home/newdisk/optnew/tslib/lib

exit

湾编辑qt-everywhere中的qmake.conf-opensource-src-5.7.0 / qtbase / mkspecs / linux-arm-gnueabi -g ++ / qmake.conf

 lmk@lmk-virtual-machine:/home/newdisk/qt-everywhere-opensource-src-5.5.1/qtbase/mkspecs/linux-arm-gnueabi-g++$ sudo vi qmake.conf

 #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 #eglfs
 QMAKE_CFLAGS_RELEASE += -O2 -march=armv6
 QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv6

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

 # modifications to g++.conf
 QMAKE_CC                = /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-gcc
 QMAKE_CXX               = /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-g++
 QMAKE_LINK              = /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-g++
 QMAKE_LINK_SHLIB        = /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-g++

 # modifications to linux.conf
 QMAKE_AR                = /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-ar cqs
 QMAKE_OBJCOPY           = /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-objcopy
 QMAKE_NM                = /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-nm -P
 QMAKE_STRIP             = /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-strip
 load(qt_config) 

℃。然后我运行autoconfig.sh,

 lmk@lmk-virtual-machine:/home/newdisk/qt-everywhere-opensource-src-5.5.1$ sudo ./autoconfig.sh

但在我运行make之后,我遇到了一些错误,

 lmk@lmk-virtual-machine:/home/newdisk/qt-everywhere-opensource-src-5.5.1$ sudo make

 ../../include/QtCore/../../src/corelib/tools/qvector.h:380:12: warning:    assuming signed overflow does not occur when assuming that (X + c) < X is always false
 /home/newdisk/optnew/opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-g++ -c -include .pch/Qt5Gui -pipe -march=armv6 -march=armv6 -O3 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_LIBINPUT -DQT_NO_USING_NAMESPACE -DQT_BUILD_GUI_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_ENABLE_HARFBUZZ_NG -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_CORE_LIB -I. -I/home/newdisk/optnew/tslib/include -I../../include -I../../include/QtGui -I../../include/QtGui/5.5.1 -I../../include/QtGui/5.5.1/QtGui -I../3rdparty/harfbuzz-ng/include -I../3rdparty/zlib -I../../include/QtCore/5.5.1 -I../../include/QtCore/5.5.1/QtCore -I../../include/QtCore -I.moc -I../../mkspecs/linux-arm-gnueabi-g++ -o .obj/qpdf.o painting/qpdf.cpp
 painting/qpdf.cpp: In member function 'int QPdfEnginePrivate::generateRadialGradientShader(const QRadialGradient*, const QTransform&, bool)':
 painting/qpdf.cpp:2157:44: error: ambiguous overload for 'operator<<' in '((QPdf::ByteStream*)((QPdf::ByteStream*)((QPdf::ByteStream*)((QPdf::ByteStream*)s.QPdf::ByteStream::operator<<(((const char*)"<<\012/ShadingType 3\012/ColorSpace ")))->QPdf::ByteStream::operator<<((alpha ? ((const char*)"/DeviceGray\012") : ((const char*)"/DeviceRGB\012"))))->QPdf::ByteStream::operator<<(((const char*)"/AntiAlias true\012/Domain [0 1]\012/Coords [")))->QPdf::ByteStream::operator<<(p0.QPointF::x()))->QPdf::ByteStream::operator<<(p0.QPointF::y()) << r0'
 painting/qpdf.cpp:180:17: note: candidates are: QPdf::ByteStream& QPdf::ByteStream::operator<<(char)
 painting/qpdf.cpp:218:17: note:                 QPdf::ByteStream& QPdf::ByteStream::operator<<(qreal)
 painting/qpdf.cpp:225:17: note:                 QPdf::ByteStream& QPdf::ByteStream::operator<<(int)
 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 ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:38,
                  from ../../include/QtCore/qcoreapplication.h:1,
                  from kernel/qt_gui_pch.h:53:
 ./../include/QtCore/../../src/corelib/tools/qbytearray.h: In member function 'void QPdfEnginePrivate::xprintf(const char*, ...)':
 ../../include/QtCore/../../src/corelib/tools/qbytearray.h:98:19: note: the mangling of 'va_list' has changed in GCC 4.4
 make[3]: *** [.obj/qpdf.o] Error 1
 make[3]: Leaving directory `/home/newdisk/qt-everywhere-opensource-src-5.5.1/qtbase/src/gui'
 make[2]: *** [sub-gui-make_first] Error 2
 make[2]: Leaving directory `/home/newdisk/qt-everywhere-opensource-src-5.5.1/qtbase/src'
 make[1]: *** [sub-src-make_first] Error 2
 make[1]: Leaving directory `/home/newdisk/qt-everywhere-opensource-src-5.5.1/qtbase'
 make: *** [module-qtbase-make_first] Error 2

您能否告诉我如何消除这些错误?我使用的是Qt5.5.1和ubuntu 14.04,我的arm板是armv6架构!

此外,第2157行和绘画/ qpdf.cpp中的相对行如下:

int function = createShadingFunction(gradient, from, to, reflect, alpha);

QByteArray shader;
QPdf::ByteStream s(&shader);
s << "<<\n"
    "/ShadingType 3\n"
    "/ColorSpace " << (alpha ? "/DeviceGray\n" : "/DeviceRGB\n") <<
    "/AntiAlias true\n"
    "/Domain [0 1]\n"
    "/Coords [" << p0.x() << p0.y() << r0 << p1.x() << p1.y() << r1 << "]\n"//2157 line
    "/Extend [true true]\n"
    "/Function " << function << "0 R\n"
    ">>\n"
    "endobj\n";
int shaderObject = addXrefEntry(-1);
write(shader);
return shaderObject;

1 个答案:

答案 0 :(得分:0)

相对文件是qt源代码。 qt官方网站上有一些解释:

typedef qreal Typedef for double unless Qt is configured with the -qreal float option.

我推断的原因是当使用参数make运行-qreal float时,发生了错误:ambiguous overload for 'operator<<'

最后,我编辑了文件autoconfig.sh而没有-qreal float并再次运行make,没有错误!