编译裁剪QT时,开始可以编译通过,加上一些配置时-no-xmlpatterns \ -no-multimedia \报错如下:
The tslib functionality test failed!
You might need to modify the include and library search paths by editing QMAKE_INCDIR and QMAKE_LIBDIR in /home/ubuntu/am335x/qt-everywhere-opensource-src-4.8.6/mkspecs/qws/linux-arm-g++.
按照要求:添加
QMAKE_LIBDIR=/usr/local/arm/tslib/lib
QMAKE_INCDIR=/usr/local/arm/tslib/include
即:/home/ubuntu/am335x/qt-everywhere-opensource-src-4.8.6/mkspecs/qws/linux-arm-g++/qmake.conf:
#
# qmake configuration for building with arm-linux-g++
#
include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/qws.conf)
QMAKE_LIBDIR=/usr/local/arm/tslib/lib
QMAKE_INCDIR=/usr/local/arm/tslib/include
# modifications to g++.confQMAKE_CC = arm-linux-gcc
QMAKE_CXX = arm-linux-g++
QMAKE_LINK = arm-linux-g++
QMAKE_LINK_SHLIB = arm-linux-g++
# modifications to linux.conf
QMAKE_AR = arm-linux-ar cqs
QMAKE_OBJCOPY = arm-linux-objcopy
QMAKE_STRIP = arm-linux-strip
load(qt_config)
编译仍报相同错误;
查看configure源码发现:
for mouse in ${CFG_MOUSE_ON} ${CFG_MOUSE_PLUGIN}; do
if [ "${mouse}" = "tslib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
"$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/tslib "tslib" $L_FLAGS $I_FLAGS $l_FLAGS
if [ $? != "0" ]; then
echo "The tslib functionality test failed!"
echo " You might need to modify the include and library search paths by editing"
echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
echo " ${XQMAKESPEC}."
exit 1
不光是着不到库会报这个错,着不到编译器,一样报这个错。
所以说
#
# qmake configuration for building with arm-linux-g++
#
QMAKE_INCDIR +=/usr/local/include/
QMAKE_LIBDIR +=/usr/local/lib/
QMAKE_LIBDIR +=/usr/local/lib/ts
include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)
# modifications to g++.conf
QMAKE_CC = /usr/local/arm/arm-2009q3/bin/arm-linux-gcc -lts
QMAKE_CXX = /usr/local/arm/arm-2009q3/bin/arm-linux-g++ -lts
QMAKE_LINK = /usr/local/arm/arm-2009q3/bin/arm-linux-g++ -lts
QMAKE_LINK_SHLIB = /usr/local/arm/arm-2009q3/bin/arm-linux-g++ -lts
# modifications to linux.conf
QMAKE_AR = /usr/local/arm/arm-2009q3/bin/arm-linux-ar cqs
QMAKE_OBJCOPY = /usr/local/arm/arm-2009q3/bin/arm-linux-objcopy
QMAKE_STRIP = /usr/local/arm/arm-2009q3/bin/arm-linux-strip
load(qt_config)
添加编译器绝对地址,编译通过。