OMAP353x 移植qt4

来源:互联网 发布:华山 长空栈道 知乎 编辑:程序博客网 时间:2024/05/18 02:12

参考文章:

http://blog.chinaunix.net/space.php?uid=22666718&do=blog&id=1771700

http://blog.csdn.net/glorin/article/details/6527598


环境:

ubuntu 10.4

qt:qt-everywhere-opensource-src-4.7.0.tar.gz

编译器:

arm920t-eabi.tgz

1.安装新的交叉编译器:
# tar zxvf arm920t-eabi.tgz -C /
会安装至 /opt/toolchains/arm920t-eabi/ 目录。

把 "/opt/toolchains/arm920t-eabi/arm-angstrom-linux-gnueabi/lib" 目录下的 libz.so libz.so.1 libz.so.1.2.3 三个动态链接库文件拷贝至开发板 /lib 目录,因为 Qt 要用到!

换个新的终端执行:
# export PATH=/opt/toolchains/arm920t-eabi/bin/:$PATH
因为要使用新的交叉编译器!

2.

配置QtE4.7.0
将qt-everywhere-opensource-src-4.7.0.tar.gz压缩包放在/opt下,解压:

#cd /opt

#tar zxvf qt-everywhere-opensource-src-4.7.0.tar.gz

#mv qt-everywhere-opensource-src-4.7.0 qt-4.7.0-arm

#cd qt-4.7.0-arm

3.

配置:

./configure -prefix /home/nzm/qt/arm-qt4 -fast -no-largefile -no-qt3support -no-mmx -no-3dnow -no-xmlpatterns -no-webkit -no-svg -nomake demo -nomake docs -no-openssl -embedded arm -little-endian -no-qvfb -no-mouse-qvfb -depths 16 -confirm-license -xplatform qws/linux-arm-g++ -no-xcursor -no-xfixes -qt-mouse-tslib -I/usr/local/tslib/include -L/usr/local/tslib/lib

编译:
# make

出错,缺少zlib库,如果是ubuntu的话,可以通过以下的命令来安装zlib-dev:
# apt-get install zlib1g-dev

再编译:
# make


安装:
# make install

下载 /opt/arm-qt4 目录到开发板 /opt/ 目录,可去掉一些例子与字体。


注意板子的目录要和电脑的一致/home/nzm/qt/arm-qt4


4.板子上环境变量

export QTDIR=/home/nzm/qt/arm-qt4
export T_ROOT=/tslib
export PATH=$QTDIR/bin:$PATH
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_PLUGINDIR=$T_ROOT/lib/ts
export TSLIB_CONFFILE=$T_ROOT/etc/ts.conf
export TSLIB_CALIBFILE=/etc/pointercal
export QWS_MOUSE_PROTO=tslib:/dev/input/event0
export LD_LIBRARY_PATH=$T_ROOT/lib:$QTDIR/lib


5.电脑编译qt程序

出错:
ld: warning: libts-0.0.so.0, needed by /[Up-level Directory]/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so, not found (try using -rpath or -rpath-link)
/[Up-level Directory]/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_read_raw'
/[Up-level Directory]/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_open'
/[Up-level Directory]/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_fd'
/[Up-level Directory]/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_config'
/[Up-level Directory]/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_close'
/[Up-level Directory]/qt-everywhere-opensource-src-4.6.2/lib/libQtGui.so: undefined reference to `ts_read'
collect2: ld returned 1 exit status
make: *** [oventimer] Error 1
解决:
运行arm-qmake2 -project 在qt.pro添加一行 再运行arm-qmake2 make
QMAKE_LFLAGS += -Wl,-rpath-link=/usr/local/tslib/lib


6.板子执行出错

出错:
root@omap3evm:/mnt/ti-dsp/opt/qt# ./qt -qws
QFontDatabase: Cannot find font directory /home/nzm/qt/arm-qt4/lib/fonts - is Qt installed correctly?
解决:
把生成的arm-qt4 放到板子上的/home/nzm/qt/目录,不能随便放要对应

出错:
root@omap3evm:/mnt/ti-dsp/opt/qt# ./qt -qws
No raw modules loaded.
QWSTslibMouseHandlerPrivate: ts_config() failed with error: 'No such file or directory'
Please check your tslib installation!
./qt: relocation error: /home/nzm/qt/arm-qt4/lib/libQtGui.so.4: symbol powf, version GLIBCXX_3.4 not defined in file libstdc++.so.6 with link time reference
解决:
把 root@omap3evm:/tslib/etc# ls
ts.conf
里的第二行 # module_raw input  注释取消
# Uncomment if you wish to use the linux input layer event interface
module_raw input (尽头有个空格也会出现Segmentation fault)

# Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d
# module_raw collie

# Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860
# module_raw corgi

# Uncomment if you're using a device with a UCB1200/1300/1400 TS interface
# module_raw ucb1x00

# Uncomment if you're using an HP iPaq h3600 or similar
# module_raw h3600

# Uncomment if you're using a Hitachi Webpad
# module_raw mk712

# Uncomment if you're using an IBM Arctic II
# module_raw arctic2

出错:
./qt: relocation error: /home/nzm/qt/arm-qt4/lib/libQtGui.so.4: symbol powf, version GLIBCXX_3.4 not defined in file libstdc++.so.6 with link time reference
解决:
此时是由于缺少与安装qte版本对应编译器的lib库的问题。
解决办法:是进入主机/opt/toolchains/arm920t-eabi /arm-angstrom-linux-gnueabi/lib目录下找到libstdc++.so.6链接的文件 libstdc++.so.6.0.8(通过右键属性——〉基本,可以看到链接的文件),复制并重命名为libstdc++.so.6到
板子上/usr/lib文件夹下,之前别忘了将该文件夹下的libstdc++.so.6移到其它地方或重命名,如libstdc++.so.6.old。同时也可以不使用覆盖的方法,通过连接的方法实现。
唧把libstdc++.so.6.0.8命名为libstdc++.so.6放到板子上


7. 到此可显示,但是触摸屏和鼠标都不能用
原创粉丝点击