根据“Ubuntu下Qt4.7.1编译环境配置说明.pdf”编译,碰到了很多麻烦。各步骤说明如下:
前几步没问题。
1.4步产生configure文件,用gedit打开,屏蔽第15896和第15948行,可去除tslib编译中的undefined reference to `rpl_malloc'这一error。
1.5步,echo "ac_cv_func_malloc_0 _nonnull=yes">arm-linux.cache这一句无效,对后面的错误不起作用,不必输入。
直接从./configure开始输:
# ./configure --host=arm-linux --cache-file=arm-linux.cache --enable-inputapi=no PLUGIN_DIR=/usr/local/arm/tslib/plugins
-prefix=/usr/local/arm/tslib 2>&1 | tee conf_log (注意参数用空格,不要跟pdf中那样换行,pdf中还有重复)这一步产生config.h。
修改tests下的ts_calibrate.c文件:
,加入这两个参数,可去除“/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments”这一错误。
1.6步make 2>& | tee make_log “&”后面少了“1”,应该是make 2>&1 | tee make_log
一直到最后编译完tslib。
成功编译完tslib后,应该是:
,bin、include、lib自动全部生成,无需拷贝。
成功编译了tslib,下面编译qt4.5就不会提示
“ 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/liuqiqi/source/qt/qt-everywhere-opensource-src-4.7.2/mkspecs/qws/linux-arm-g++”
这个错误,否则按网上写的修改qt配置文件的办法均无效。修改后,一运行build-all所有配置恢复原状。只有成功编译完tslib,后面才一路畅通。
按教程编译qt4.5最后显示:
/qt-everywhere-opensource-src-4.7.1/qt-everywhere-opensource-src-4.7.1/lib/libQtGui.so: undefined reference to `ts_open'
/qt-everywhere-opensource-src-4.7.1/qt-everywhere-opensource-src-4.7.1/lib/libQtGui.so: undefined reference to `ts_fd'
/qt-everywhere-opensource-src-4.7.1/qt-everywhere-opensource-src-4.7.1/lib/libQtGui.so: undefined reference to `ts_config'
/qt-everywhere-opensource-src-4.7.1/qt-everywhere-opensource-src-4.7.1/lib/libQtGui.so: undefined reference to `ts_close'
/qt-everywhere-opensource-src-4.7.1/qt-everywhere-opensource-src-4.7.1/lib/libQtGui.so: undefined reference to `ts_read'
collect2: ld returned 1 exit status
make[3]: *** [blockingfortuneclient] Error 1
后面的错误都是这五个/lib/libQtGui.so: undefined reference导致的,我没按教程来,而是用的网上的方法:
把/usr/local/arm/tslib下的相关库
libts-0.0.so.0 libts-0.0.so.0.1.0 libts.so
拷到编译器库里面/usr/local/arm/arm-2009q3/arm-none-linux-gnueabi/libc/lib,make distclean后,再次./build_all,
最后显示一大串:
cp -f -r /qt-everywhere-opensource-src-4.7.1/qt-everywhere-opensource-src-4.7.1/mkspecs/wincewm50pocket-msvc2008 /opt/qt-4.7.1/mkspecs/
cp -f -r /qt-everywhere-opensource-src-4.7.1/qt-everywhere-opensource-src-4.7.1/mkspecs/wincewm50smart-msvc2005 /opt/qt-4.7.1/mkspecs/
cp -f -r /qt-everywhere-opensource-src-4.7.1/qt-everywhere-opensource-src-4.7.1/mkspecs/wincewm50smart-msvc2008 /opt/qt-4.7.1/mkspecs/
cp -f -r /qt-everywhere-opensource-src-4.7.1/qt-everywhere-opensource-src-4.7.1/mkspecs/wincewm60professional-msvc2005 /opt/qt-4.7.1/mkspecs/
cp -f -r /qt-everywhere-opensource-src-4.7.1/qt-everywhere-opensource-src-4.7.1/mkspecs/wincewm60professional-msvc2008 /opt/qt-4.7.1/mkspecs/
cp -f -r
没再提示错误,应该是完整编译完了。