1移植konqueror遇到好大的麻烦!总是出现 checking for Qt... configure: error: Qt (>= Qt 2.2.2) (library qte) not found. Please check your
2并且按照网上的解决方法,根本解决不了我的问题!
3因为我的libpng,libz,以及libts等都没有copy到交叉工具链arm-linux目录下,需要自己指定路径,所以导致的这个问题解决不了。当然这也是在成功之后总结出来的,没成功之前根本不知道!
4后面./configure阶段和make阶段出现的各个问题基本上都和这几个库有关系!特别是因为我的qtopia使用了触屏防抖动的tslib-1.4库,需要修改configure加上-lts对libts支持。
5还有一点就是这个版本的konqueror对qtopia-2.2.0指定的版本信息没有找对位置要手动修改configure!
Ø 1编译器:arm-linux-3.3.2
Ø 2平台:qtopia-2.2.0
Ø 3环境变量:使用3.qtopia-arm-2.2.0.sh环境变量,后来使用qtopia-2.2.0自带的setQpeEnv!区别在于QPEDIR的设置!自己写的环境变量QPEDIR为install后的qtopia目录,而自带的QPEDIR设为编译目录下的qtopia,而这个目录里有qpe的include文件!
Ø 4因为之前qtopia是在root用户下编译的,所以使用时可能有一些不能访问的权限问题,所以只要修改下权限就可。如qt2/lib/fonts,qconfig.h
下载:konqueror-embedded-snapshot-20030705.tar.gz
cd konq source /usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0/setQpeEnv env $QTDIR env $QPEDIR ./configure \ CC=arm-linux-gcc \ CXX=arm-linux-g++ \ LDFLAGS=-ldl \ CROSS_COMPILE=1 \ --build=i686-linux \ //本地linux --host=arm-linux \ //arm运行的linux --target=arm-linux \ //arm运行的linux --enable-qt-embedded \ //库:对qt-e库的支持!嵌入式设备中要有qt-e而非qt --enable-qpe \ //库:对qtopia库的支持, //这样能够利用QPE库的API,节省桌面环境资源 //也就是说,可以再没有qtopia桌面环境中,只是用qt-e库! --enable-embedded \ //使用环境:支持arm运行时的qt-e环境 --enable-qtopia \ //使用环境:支持arm运行时的qtopia环境 --with-gui=qpe \ //默认的是x11桌面环境 --disable-debug \ --enable-static \ //静态 --disable-shared \ --disable-mt \ //多进程 --enable-add-ons=kflashpart \ //加入flash支持! --without-ssl \ --with-qt-dir=$QTDIR \ --with-qt-includes=$QTDIR/include \ //qtopia-2.2.0中qt-e头文件在qt2中, --with-qt-libraries=$QPEDIR/lib \ //而库libqte在qtopia中! --with-qtopia-dir=$QPEDIR \ --with-extra-includes=/usr/local/qtopia-arm-2.2.0/install-others/include: $QPEDIR/include: //libpng,libjepg,libz等库! $QTDIR/include: /usr/local/arm/3.3.2/include: //libts /usr/local/qtopia-arm-2.2.0/install-tslib-1.4/include \ --with-extra-libs=/usr/local/qtopia-arm-2.2.0/install-others/lib: $QPEDIR/lib: $QTDIR/lib: /usr/local/arm/3.3.2/lib: /usr/local/qtopia-arm-2.2.0/install-tslib-1.4/lib \ --prefix=/home/richardnee/konq-arm/install-konq //--prefix默认的是/usr/,不能默认,因为链接时,会链接到/usr/lib下的libpng.so等,编译不通过! #make #make install #arm-linux-strip --strip-all konq-embed/src/konqueror
问题1:configure阶段:QTE库找不到
checking for Qt... configure: error: Qt (>= Qt 2.2.2) (library qte) not found. Please check your installation! For more details about this problem, look at the end of config.log.
最终解决方法:
修改configure 22141行,在ac_link中加入-lts对libts库的支持!
问题解决分析:
1通过在几个关键地方加入echo "$ac_xxx"显示当前的qt的ac_qt_includes,ac_qt_libraries目录从而找到问题所在;原来是ac_qt_libraries="NO"
2进一步向上追溯:是ac_link=xx,缺少对库libts的制定-lts,从而导致下面错误:在config.log中:
/usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: libts-0.0.so.0, needed by /usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0/qtopia/lib/libqte.so, not found (try using -rpath or -rpath-link) /usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0/qtopia/lib/libqte.so: undefined reference to `ts_close'
3到configure:22214: 上面最近一个ac_link中加入-lts,在22141附近!
问题2:configure阶段:libts库找不到,并且找不到qtopia的版本头文件version.h
checking for Qtopia... ./configure: line 24305: test: : integer expression expected configure: error: Cannot link small Qtopia Application. For more details look at the end of config.log
1 qtopia版本问题:因为konqueror和qtopia-2.2.0版本不必配的原因,konqueror找到的version.h没有真正的版本信息,只是一个包含链接include"",真正的版本信息在$QPEDIR/src/libraries/qtopia/version.h中,所以修改configure中24299-24301行:
$qtopia_incdir/qpe/version.h 改为 $qtopia_incdir/../src/libraries/qtopia/version.h
2 libts库找不到问题:同问题1一样:
在configure的24321行的ac_link中加入-lts对libts库的支持!
问题3:make阶段:libts库找不到
/usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: libts-0.0.so.0, needed by /usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0/qtopia/lib/libqpe.so, not found (try using -rpath or -rpath-link) /usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0/qtopia/lib/libqte.so: undefined reference to `ts_open'
解决方法:同问题1,2一样,在konq-embed/src/Makefile中的LDFLAGS加入-lts:大约132行:
LDFLAGS = -ldl -lts
问题4:configure阶段:(konqueror-embedded-snapshot-20030705.tar.gz)
/usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0/qtopia/include/qpe/../../src/libraries/qtopia/qpeapplication.h:87: error: comma at end of enumerator list
解决方法:在$QPEDIR/src/libraries/qtopia/qpeapplication.h第86行去掉逗号“,”
77 enum InputMethodHint { 78 Normal, 79 AlwaysOff, 80 AlwaysOn 81 , 82 Number, 83 PhoneNumber, 84 Words, 85 Text, 86 Named, //逗号去掉 87 };
In file included from kflashpart.h:16, from kflashpart.cpp:14: flashlib/flash.h:78: error: comma at end of enumerator list make[6]: *** [kflashpart.lo] Error 1 make[6]: Leaving directory `/home/richardnee/konq-arm/konqueror-embedded/konq-embed/add-ons/kflashpart'
解决方法:vi konq-embed/add-ons/kflashpart/flashlib/flash.h去掉77行逗号:
69 enum FlashEventType { 70 FeNone, 71 FeMouseMove, 72 FeButtonPress, 73 FeButtonRelease, 74 FeRefresh, 75 FeKeyPress, 76 /* internal events */ 77 FeKeyRelease, //去掉逗号 78 };
/home/ricahrdnee/konq-arm/install-konq目录下会生成konqueror/E移植所需要的可执行文件以及配置文件,将konqueror相关文件拷贝:
Mkdir -p opt/kde Mkdir -p opt/Qtopia/pics/konqueror/ Mkdir -p opt/Qtopia/apps/ARM2410/ cp apps/Applications/konqueror.desktop opt/Qtopia/apps/ARM2410/ cp bin/arm-linux-konqueror opt/Qtopia/bin/konqueror cp pics/konqueror.png opt/Qtopia/pics/konqueror/ cp -arvf share/ opt/kde/
修改/etc/profile.d/qtopia.sh的qtopia脚本,加入:
export set KDEDIR=/opt/kde
不是是不是因为没有安装boa的http服务等,konqueror运行时,比如输入www.baidu.com,会出现Unknown host www.baidu.com!
在确保DNS的resolv.conf设置的namesever=8.8.8.8设置正确的前提下还是出现该错误!
然后ping百度域名:
ping www.baidu.com
ping: bad address 'www.baidu.com'
然而直接ping百度的ip可以ping通
Ping 202.108.22.5
Ø 经熟悉网络的童鞋指点是DNS有问题,并非我所设想的httpd守护进程没开!
Ø 如网友所指出的busybox的命令帮助页面上找到了这样一段话:
LIBC NSS
When used with glibc, the BusyBox 'networking' applets will similarly require that you install at least some of the glibc NSS stuff (in particular, /etc/nsswitch.conf, /lib/libnss_dns*, /lib/libnss_files*, and /lib/libresolv*).
所以应该是和DNS有关的几个库、配置没有,导致无法解析域名!
把这几个文件copy到arm上。Busybox使用3.4.1交叉工具链编译的所以用3.4.1中的库!
cp /usr/local/arm/3.4.1/lib/libnss_dns* lib/ -arvf cp /usr/local/arm/3.4.1/lib/libnss_files* lib/ -arvf cp /usr/local/arm/3.4.1/lib/libresolv* lib/ -arvf
resolv.conf已经有启动shell设置了
从本地主机上copy和host有关的配置文件
Cp /etc/host* etc/ -v果然就可以ping通百度了! 然后 konqueror可能够浏览网页了了!
由于QT/E是可以支持Unicode编码,因此Konqueror/E也可以支持中文,但是在编译QT/E缺省配置中是不支持Unicode。所以要做一下两处修改:
Ø 1 修改QT/E,Qtopia对Unicode支持,支持中文:
手动修改qt2和qtopia目录中的qconfig-qpe.h文件配置,注释掉38行,#define QT_NO_CODECS。
find qtopia-free-2.2.0/ -name qconfig-qpe.h
qtopia-free-2.2.0/qtopia/src/qt/qconfig-qpe.h
qtopia-free-2.2.0/qt2/src/tools/qconfig-qpe.h
qtopia-free-2.2.0/qt2/include/qconfig-qpe.h
或者./configure -qpe "....... -fontfamilies "helvetica fixed micro smallsmooth smoothtimes unifont" ......."
改为:./configure -qpe "....... -fontfamilies "unifont" ......."
cd /usr/local/qtopia-arm-2.2.0/qtopia-free-2.2.0 ./configure \ -qte "-embedded -xplatform linux-arm-g++ \ -qconfig qpe -no-qvfb -depths 8,16,24,32 \ -system-jpeg -system-libpng -system-zlib -gif \ -thread -no-xft -release \ -tslib \ -I/usr/local/qtopia-arm-2.2.0/install-tslib-1.4/include \ -I/usr/local/qtopia-arm-2.2.0/install-others/include \ -L/usr/local/qtopia-arm-2.2.0/install-tslib-1.4/lib \ -L/usr/local/qtopia-arm-2.2.0/install-others/lib \ -lpng -lts -lz -luuid -ljpeg" \ -qpe "-xplatform linux-arm-g++ -luuid \ -edition pda -displaysize 320x240 \ -fontfamilies "helvetica fixed micro smallsmooth smoothtimes unifont"改为: -fontfamilies "unifont" \ -I/usr/local/qtopia-arm-2.2.0/install-others/include \ -I/usr/local/qtopia-arm-2.2.0/install-tslib-1.4/include \ -L/usr/local/qtopia-arm-2.2.0/install-others/lib \ -L/usr/local/qtopia-arm-2.2.0/install-tslib-1.4/lib \ -prefix=/usr/local/qtopia-arm-2.2.0/install-qtopia-2.2.0" \ -qt2 "-no-opengl -no-xft" \ -dqt "-no-xft -thread" 2>&1 | tee config.log
Ø 2 修改Konqueror/E支持Unicode:
要在Konqueror页面上显示,就必须要有相应字体,因此对Konqueror/E源代码中/konq-embed/dropin/ kglobalsettings.cpp文件进行修改,将"helvetica"改为"unifont"后重新编译Konqueror/E,这样Konqueror/E中就能显示中文字体页面了。
Vi konq-embed/dropin/ kglobalsettings.cpp 将"helvetica"改为"unifont"
这样修改完毕以后,重新开始编译QT/E以及Qtopia和Konuqueror/E,Konqueror/E就能接受Unicode编码汉字了。
之前的好像就已经可以浏览中文网页,显示汉字,只是有个别的乱码;改过之后也一样!
摘录http://www.konqueror.org/embedded/
1 How can I make Konq/E pick up the Qt/Embedded library instead of the normal Qt lib?
If you want to compile with Qt/Embedded support, then you have to configure it with the --enable-qt-embedded configure switch. Also make sure the QTDIR is set correctly.
关于QT-E的支持:
一:需要qte库;
二:配置时设置--enable-qt-embedded;
三:设置QTDIR指向qte的目录;
I heard there's special support for the Qt Palmtop Environment?
There is a --enable-qpe configure switch which will make Konq/E link against the Qt Palmtop Environment libraries (and use them) . The support involves inherittance of the QPEApplication base application class and use of the QPE shared status message feature (re-using the task-bar for status messages, to avoid wasting screen space with an application status bar) . Make sure to have QPEDIR set then using this switch.
关于qtopia的支持:
一:需要qtopia库,如libqpe,libqtopia;这样能够利用QPE库的应用程序接口,节省桌面环境资源;
二:配置时设置--enable-qpe;
三:设置QPEDIR指向qtopia的目录
原创作品,转载请注明原作者及地址!
by 飞鸿惊雪