本人在ubuntu 11.04中编译出现的错误笔记
菜鸟一只 所以 其中可能出现很多输入手误 还有可能出现原理性错误 如有高手发现 可在评论指出 不胜感激
编辑脚本:
#qte源码解压路径/root/build_qt/qte
#tslib安装路径 /share/tslib
export CPLUS_INCLUDE_PATH=/usr/local/arm/4.1.2/arm-angstrom-linux-gnueabi/include/c :/usr/local/arm/4.1.2/arm-angstrom-linux-gnueabi/include/c :/arm-angstrom-linux-gnueabi:$CPLUS_INCLUDE_PATH
export QMAKE_INCDIR=/root/build_qt/qte/mkspecs/qws/linux-arm-g
echo yes | ./configure -opensource -embedded arm -xplatform qws/linux-arm-g -nomake tools -webkit -qt-libtiff -qt-libpng -system-libpng -qt-libjpeg -system-libjpeg -qt-libmng -qt-mouse-tslib -no-neon -I/share/tslib/include -L/share/tslib/lib -lts -depths 4,8,16,32 -qvfb 2>&1 | tee ./qteconfig.log
make && make install 2>&1 | tee ./qtemake.logsource install.sh
执行相应配置后
*在安装qte库前 要确保先安装了libpeng库
# cd /usr/local/arm/4.1.2/arm-angstrom-linux-gnueabi/lib 或者 # cd /usr/local/arm/4.1.2/lib 或者 # cd /usr/local/arm/4.1.2/arm-linux/lib
查看是否存在
若不存在
可到http://libpng.sourceforge.net/ 下载 也可下载我这个 lpng1513.rar
解压后
# cd /root/lpng1513/lpng1513/scripts/
# vim makefile.linux
修改为
修改为
#交叉编译工具地址/usr/local/arm/4.1.2
22 AR_RC=arm-linux-ar rc
23 CC=arm-linux-gcc
26 RANLIB=arm-linux-ranlib
32 prefix=/usr/local/arm/4.1.2/arm-angstrom-linux-gnueabi/
# cd ..
# make -f scripts/makefile.linux
# make -f scripts/makefile.linux install
# make -f scripts/makefile.linux install
安装成功后
/usr
/local
/arm
/4
.1
.2
/arm
-angstrom
-linux
-gnueabi
/lib 目录中出现 libpnd.a libpnd.so文件
完成后就可以开始编译了,期间会出现几个小错误
出现错误1:
/root/build_qt/qte/src/corelib/tools/qlocale.cpp: In function ‘char* qdtoa(double, int, int, int*, int*, char**, char**)’:
/root/build_qt/qte/src/corelib/tools/qlocale.cpp:6639:5: error: ‘fenv_t’ was not declared in this scope
/root/build_qt/qte/src/corelib/tools/qlocale.cpp:6639:12: error: expected ‘;’ before ‘envp’
/root/build_qt/qte/src/corelib/tools/qlocale.cpp:6640:19: error: ‘envp’ was not declared in this scope
/root/build_qt/qte/src/corelib/tools/qlocale.cpp:6640:23: error: ‘feholdexcept’ was not declared in this scope
/root/build_qt/qte/src/corelib/tools/qlocale.cpp:6655:19: error: ‘fesetenv’ was not declared in this scope
make: *** [qlocale.o] 错误 1
目前解决方法:把/usr/include中的fenv.h 复制到qlocale.cpp所在目录
并修改#include 为#include "fenv.h"
#vim /root/build_qt/qte/src/corelib/tools/qlocale.cpp
第81行中#include 改成#include "fenv.h"
cp /usr/include/fenv.h /root/build_qt/qte/src/corelib/tools/
出现错误2:
/usr/bin/ld: cannot find -lts
collect2: ld returned 1 exit status
make[1]: *** [../../../bin/moc] 错误 1
make[1]:正在离开目录 `/root/build_qt/qte/src/tools/moc
解决方法:
把pc上的qt目录下bin中的moc工具复制到qte的bin目录中 (我pc中的qt目录为/usr/local/Trolltech/Qt-4.7.2)
# cp /usr/local/Trolltech/Qt-4.7.2/bin/moc ./bin
# make
这个问题 尽管之前复制过 还是会出现的 而且会出现3次,分别是 moc、rcc、uic
分别在出错的时候复制过去就好了
出现错误3:
make[1]: *** [.obj/release-shared-emb-arm/main.o] 错误 1
make[1]:正在离开目录 `/root/build_qt/qte/tools/linguist/lrelease
解决方法:
重新打开一个新终端 进行make操作
原因:当前运营到g 编译,但程序中的环境变量还是采用脚本中的arm-linux-g 环境 所以重新使用原环境变量进行编译
出现错误4:
/usr/bin/ld: cannot find -lts
collect2: ld returned 1 exit status
make[1]: *** [../../../bin/lrelease] 错误 1
make[1]:正在离开目录 `/root/build_qt/qte/tools/linguist/lrelease
解决方法:
# cp /usr/local/Trolltech/Qt-4.7.2/bin/lrelease ./bin
# make
出现错误5:
make[3]: *** [.obj/release-shared-emb-arm/main.o] 错误 1
make[3]:正在离开目录 `/root/build_qt/qte/examples/network/download'
make[2]: *** [sub-download-make_default] 错误 2
make[2]:正在离开目录 `/root/build_qt/qte/examples/network'
make[1]: *** [sub-network-make_default] 错误 2
make[1]:正在离开目录 `/root/build_qt/qte/examples
发现是png的问题
# cd
/usr
/local
/arm
/4
.1
.2
/arm
-angstrom
-linux
-gnueabi
/lib
# ln -s libpng15.so.15.13 libpng15.so.15
# export /usr/local/arm/4.1.2/arm-angstrom-linux-gnueabi/include/c :/usr/local/arm/4.1.2/arm-angstrom-linux-gnueabi/include/c /arm-angstrom-linux-gnueabi:/usr/local/arm/4.1.2/arm-angstrom-linux-gnueabi/include/c
#make
END