qt-4.8.5移植tq2440成功
来源:互联网 发布:淘宝情趣店记事 编辑:程序博客网 时间:2024/05/21 22:29
环境:
Fedora 17
arm-linux-gcc 4.3.2
tq2440 》linux-2.6.39
qt安装
cd qt-everywhere-opensource-src-4.8.5/
1.配置echo yes | ./configure -prefix /usr/local/qte-arm -opensource -embedded arm -xplatform qws/linux-arm-g++ -no-webkit -qt-libtiff -qt-libmng -qt-mouse-tslib -qt-mouse-pc -no-mouse-linuxtp -no-neon
#安装位置-prefix /usr/local/qte-arm
提示gmake命令找不到,在添加删除程序中,搜索gcc,g++,找到c++ support for gcc,安装完就好了
3.make install
使用
复制/usr/local/qte-arm下面的lib和plugins文件夹至开发板文件系统相同目录
开发板文件系统下/etc/profile添加:
# tslib
export USER LOGNAME PS1 PATH
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
# qt path
export QTDIR=/usr/local/qte-arm
export QTDIRlib=/usr/local/qte-arm/lib
export LD_LIBRARY_PATH=$QTDIRlib:$LD_LIBRARY_PATH
export PATH=$QTDIR/bin:$PATH
export QWS_MOUSE_PROTO=tslib:/dev/event0
export QWS_DISPLAY="LinuxFb:mmWidth480:mmHeight272:0"
export QT_QWS_FONTDIR=/usr/local/qte-arm/lib/fonts
qt_test
编写一个简单的测试程序,文件名为hello.cpp,进入该文件目录,进行工程编译,看是否能正确通编译
hello.cpp源码:
#include <QApplication>
#include <QDebug>
int main(int argc,char *argv[])
{
qDebug("Hello, welcome to Qt world!");
return 0;
}
设置环境变量
1.运行命令 gedit /etc/profile,编辑该文件。在文件中加入:
export QTDIR=/usr/local/qte-arm /*需要修改为你的Qt安装目录*/
export LD_LIBRARY_PATH=$QTDIR/lib
export PATH=$PATH:$QTDIR/bin
保存并关闭文件。
2.运行命令 source /etc/profile。
这样,就可以在任何目录下使用qmake了。
顺序执行以下操作:
@1. 执行:qmake -project hello.cpp
生成 hello1.pro 工程文件
@2. 执行:qmake hello1.pro
生成 Makefile 文件
@3. 执行:make
生成 hello.o, hello 文件
[root@StevenKing /]# cd lib/[root@StevenKing /lib]# insmod s3c_ts.koinput: Unspecified device as /devices/virtual/input/input0[root@StevenKing /lib]# insmod cfbcopyarea.ko [root@StevenKing /lib]# insmod cfbfillrect.ko [root@StevenKing /lib]# insmod cfbimgblt.ko [root@StevenKing /lib]# insmod sk_lcd.koConsole: switching to colour frame buffer device 60x34[root@StevenKing /lib]# ts_calibrate xres = 480, yres = 272Took 2 samples...Top left : X = 281 Y = 872Took 1 samples...Top right : X = 269 Y = 186Took 2 samples...Bot right : X = 760 Y = 141Took 2 samples...Bot left : X = 749 Y = 876Took 3 samples...Center : X = 518 Y = 516528.934204 -0.023497 -0.534203-48.736877 0.358485 -0.000051Calibration constants: 34664232 -1539 -35009 -3194020 23493 -3 65536 [root@StevenKing /lib]# qt_test Hello, welcome to Qt world!
补充:
qt4.5.3不能显示中文字体,无论是qvfb中还是arm系统中,后来在网上查了一些方法
终于弄好了
1,下载文泉驿正黑字体qpf字体库
在http://kenter1643.download.csdn.net/可以找到下载
2,把下载好的字体库解压后的qpf文件放入lib/fonts中(qtX86和arm版本以及移植的文件系统中都放入此子体)
编译运行的时候:在qtcreator中在Run Settings——〉Edit run configuration:右侧单击Show Details按钮,在打开的下拉列表中Arguments:文本框中添加参数“-qws -font wenquanyi”。
或者在终端中运行:例如:./hello -qws -font wenquanyi
这样就可以显示中文了
如果不想输入后面的参数可以把lib/fonts中的其他字体全部删除,只保留泉驿正黑字体的qpf字体库。这样只需要运行./hello -qws 即可 不过这样以来就用不了其他字体了。
提示:在终端中运行程序时其后加上& 就不会独占终端了,可以在终端运行多个程序
如:./hello &
- qt-4.8.5移植tq2440成功
- TQ2440成功移植linux-2.6.29内核
- TQ2440成功移植linux-2.6.29内核
- TQ2440成功移植linux-2.6.29内核
- TQ2440成功移植linux-2.6.29内核
- TQ2440成功移植linux-2.6.29…
- QT程序移植成功
- 成功移植linux2.6.38内核到TQ2440(转)
- 成功移植linux2.6.38内核到TQ2440(转)
- Linux 2.6.35.5内核在tq2440上移植成功
- 成功移植linux2.6.38内核到TQ2440 …
- 成功移植linux2.6.38内核到TQ2440 …
- linux2.6.30.4中dm9000网卡成功移植到TQ2440
- 成功移植linux2.6.38内核到TQ2440(转)
- 成功移植ffmpeg 0.6到ARM平台 tq2440. 移植ffmpeg-0.6.3,SDL-1.2.10到tq2440
- linux-3.5.5移植到TQ2440
- tslib-1.4移植 qt-4.8.5移植
- Qt 5.5.0-成功移植到TQ210
- Linux 编译 X264
- SSH原理与运用(二):远程操作与端口转发
- jsp:include包含txt文件出现乱码问题
- CocosBuilder中拼合图片(来自TexturePacker整合)边缘有空隙的问题
- 删除邮件
- qt-4.8.5移植tq2440成功
- Objective-C NSDictionary 和 NSMutableDictionary( NSArray 类)
- 树状数组学习笔记
- 【黑马程序员】jdk1.5的新特性之可变参数和增强for循环
- 10个简单的图像悬停效果你可以拷贝和粘贴!
- C++中关键字register/auto
- 均分纸牌
- Codility上得问题之五 Delta 2011
- 正则表达式