现在的位置: 首页 > 综合 > 正文

Qt/E4.7 在s3c6410上的移植

2013年08月08日 ⁄ 综合 ⁄ 共 4679字 ⁄ 字号 评论关闭

 

   本人最近在s3c6410上进行Qt/E4.7库移植,共两个版本,一个是Qt/E4.7.0,一个是Qt/E4.7.1版本,这中间遇到了一些问题,总结了一下,记录到了这里,与大家分享,希望对您有所帮助。

 

   开发平台环境:  Ubuntu9.10,s3c6410,arm-linux-gcc 4.3.2   Qt/E  4.7.1 ,Qt/E4.7.0

 

    重要说明:

 

  A:   Qt/E4.7.0版本存在一些Bug,诺基亚2010年11月推出4.7.1版本来修正,这里使用4.7.1和4.7.0两个版本,另外交叉编译器版本也很关键,我以前用的3.4.5交叉编译器版本编译通过,但是运行提示

  QString::arg: Argument missing: "/proc/%1/exe" , 559 
  Qtig:r:Agmn isn:"po/1ee  5
  Qtig:r:Agmn isn:"po/1ee  5
  Qtig:r:Agmn isn:%ted,/
  Qtig:r:Agmn isn:"1qebde-2   ????
  Cno raeQ o meddLnxdt ietr:%ted
  Aborted

  每个测试程序都会有这样的问题,后来改换交叉编译器4.3.2编译即可通过。 您可以从这里下载和查看Qt的最新版本信息 http://qt.nokia.com/,这是诺基亚的官方网站。

 

 B  编译Qt/E4.7之前需要执行以下命令安装需要的库和工具。

 

      apt-get install libx11-dev libxext-dev libxtst-dev

 

 

    如果编译过程中提示缺少某个库,自己可以根据提示信息按照上面的方法,下载相应的库和工具即可,Ubuntu在这方面做的很不错,方便用户安装需要的工具和库文件,每个用户的桌面环境不一定都一样,要学会根据错误提示信息找到对应的解决办法,这样有利于提高自己解决问题的能力。

 

 我的编译脚本文件里面的内容:

 

  cd qt-everywhere-opensource-src-4.7.1

 

 

echo yes | ./configure -opensource -embedded arm -xplatform qws/linux-arm-g++  -no-webkit -qt-libtiff -qt-libmng  -qt-mouse-tslib -qt-mouse-pc -no-mouse-linuxtp -prefix /opt/qt-4.7.1   -I /usr/local/tslib/include -L /usr/local/tslib/lib  -D__ARM_ARCH_5TEJ__

 

make && make install

 

注意:

 

  如果您编译的是4.7.1版本可以不加D__ARM_ARCH_5TEJ__选项,按照上面的编译脚本,开始编译即可,通过,这就是我们采用4.7.1版本的原因,它解决了4.7.0在编译过程中存在的一些错误信息,让您一键编译。

 

  建议用户在选择Qt/E的版本时选择4.7.1,因为这个版本无论编译过程还是运行效果都比4.7.0好。

 

 

下面说说编译4.7.0过程中遇到的问题:

 

  在用编译器编译4.7.0版本请务必configure时,在最后面加上   -D__ARM_ARCH_5TEJ__   选项,否则编译不通过提示:

 

 

In file included from ./config.h:26,
from ../JavaScriptCore/pcre/pcre_compile.cpp:44:
../JavaScriptCore/wtf/Platform.h:338:6: #error "Not supported ARM architecture"
make[1]: *** [obj/release/pcre_compile.o] Error 1
make[1]: Leaving directory `/usr/local/qte4.6-arm/src/3rdparty/webkit/WebCore'
make: *** [sub-webkit-make_default-ordered] Error 2

填写这个选择后重新编译即可通过。

 

 

 

另外在编译4.7.0过程中还会遇到两个问题:

 

 问题1:

 QFontEngineFT::init(QFontEngine::FaceId, bool, QFontEngineFT::GlyphFormat)':
text/qfontengine_ft.cpp:696: warning: initialization to `int' from `qreal'
text/qfontengine_ft.cpp:696: warning: argument to `int' from `qreal'
{standard input}: Assembler messages:
{standard input}:1587: Error: register or shift expression expected -- `orr r3,r2,lsl#16'
{standard input}:1597: Error: register or shift expression expected -- `orr r2,r3,lsl#16'
{standard input}:3206: Error: register or shift expression expected -- `orr r3,r1,lsl#16'
{standard input}:3219: Error: register or shift expression expected -- `orr r3,ip,lsl#16'

解决办法:

  gedit   qt-everywhere-opensource-src-4.7.1/src/3rdparty/freetype/include/freetype/config/ftconfig.h Line 330.

(原来的为)  "orr %0, %2, lsl #16/n/t" /* %0 |= %2 << 16 */
(修改后为)  "orr %0, %0, %2, lsl #16/n/t" /* %0 |= %2 << 16 */

 修改完成后继续编译即可。


 

问题2:缺少slib链接库信息

 

 warning: libts-0.0.so.0, needed by , not found (try using -rpath or -rpath-link)

undefined reference to `ts_read_raw'

undefined reference to `ts_open'

undefined reference to `ts_fd'

undefined reference to `ts_config'

undefined reference to `ts_close'

undefined reference to `ts_read'

collect2: ld returned 1 exit status

 

解决办法:

修改qt-everywhere-opensource-src-4.6.0/mkspecs/qws/linux-arm-g++/qmake.conf 文件(添加lts参数):

QMAKE_CC                = arm-linux-gcc -lts

QMAKE_CXX               = arm-linux-g++ -lts

QMAKE_LINK              = arm-linux-g++ -lts

QMAKE_LINK_SHLIB        = arm-linux-g++ -lts

 

修改完成后保存退出,继续编译。

 

我在编译4.7.0过程中主要遇到了以上的几个问题,这些问题解决后把编译好的库放到开发板的  /opt 目录下面,执行我的运行脚本即可体验到Qt/E4.7带给我们的动感界面,我执行的是4.7.1的测试。

 

我的运行脚本放到这里,给大家分享:
export TSLIB_ROOT=/root/tslib/build
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_TSEVENTTYPE=H3600
export TSLIB_CONFFILE=/root/tslib/build/etc/ts.conf
export TSLIB_PLUGINDIR=/root/tslib/build/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export QTDIR=/opt/qt-4.7.1/

export LD_LIBRARY_PATH=$QTDIR/plugins/qtopialmigrate/:$QTDIR/qt_plugins/imageformats/:$QTDIR/lib:/root/tslib/build/lib:$LD_LIBRARY_PATH
export PATH=/bin:/sbin:/usr/bin/:/usr/sbin:/root/tslib/build/bin

if [ -c /dev/input/event1 ]; then
        export QWS_MOUSE_PROTO="Tslib:${TSLIB_TSDEVICE}"
        if [ -e /etc/pointercal -a ! -s /etc/pointercal ] ; then
                rm /etc/pointercal
                /root/tslib/build/bin/ts_calibrate
        fi
else
        export QWS_MOUSE_PROTO="MouseMan:/dev/input/mice"
        >/etc/pointercal
fi
export QWS_KEYBOARD=TTY:/dev/tty1

 

FB_SIZE=$(cat /sys/class/graphics/fb0/virtual_size)

#export QWS_DISPLAY="LinuxFb:mmWidth76:mmHeight44:1"
case "$FB_SIZE" in
800,480)
export QWS_DISPLAY="LinuxFb:mmWidth91:mmHeight53:1"
;;
480,272)
export QWS_DISPLAY="LinuxFb:mmWidth76:mmHeight44:1"
;;
*)
export QWS_DISPLAY="LinuxFb:mmWidth91:mmHeight53:1"
;;
esac
#export QWS_DISPLAY=:1

 

export HOME=/root

cd /opt/qt-4.7.1/demos/embedded/fluidlauncher
./fluidlauncher -qws

 

 

把脚本文件放到开发板的 /bin目录下面,在控制台中执行改脚本即可看到4.7测试程序的界面。

 

 以上的问题解决方法也参考了很多网友写的文章,在此感谢他们,也希望这篇文章对您有所帮助。

  

抱歉!评论已关闭.