分类: LINUX
2010-03-13 10:35:34
Tslib移植:
export TSLIB_TSEVENTTYPE=event0
export TSLIB_FBDEVICE=/dev/fb0 //可以不要
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CONFFILE=/mnt/nfs/etc/ts.conf
export TSLIB_CONSOLEDEVICE=none
export TSLIB_CALIBFILE=/tmp/pointercal
export TSLIB_PLUGINDIR=/mnt/nfs/share/ts/plugins
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/nfs/lib
ts_read_raw.c函数中要定义:
#define USE_INPUT_API 1
选择
#ifdef USE_INPUT_API
struct input_event ev;//和驱动里结构一样的
#else
Ucb1x00触摸屏驱动通过event0时间来控制的。
触摸屏分辨率默认640x480,修改成400x480可以完成校准。
屏大小为800x480
./autogen.sh
./configure CC=arm-linux-gcc --prefix=/root/tslib --host=arm-linux
修改/tslib/plugins/Makefile里面找rpath
将LDFLAGS :=$(LDFLAGS) -rpath $(PLUGIN_DIR)
修改为:
LDFLAGS :=$(LDFLAGS) -rpath `cd $(PLUGIN_DIR) && pwd`(这个可是顿号)
make
make install
qt-x11-
修改一个头文件错误:
qvalue…….h 中:
加入:this->
qt-embedded
[root@~qte_arm]#cp -a src/.libs/* /qte_arm/qte-
[root@~qte_arm]#cp -a plugins/.libs/*.so /qte_arm/qte-
[root@~qte_arm]#cp -f src/*.h /qte_arm/qte-
Copy tslib中的一些lib和include到qte-
修改qte-
用vi编辑/qte_arm/qte-
会提示错误
undefined reference to `operator new[](unsigned int)'
之类的错误提示
就是改一下对应的Makefile里的arm-linux-gcc 为arm-linux-g++
或者make sub-src,不编译例子
编译QT应用程序
1、QTdesiger生成ledtest.ui工程文件
2、
$QTDIR/bin/uic -o ledtest.h ledtest.ui
$QTDIR/bin/uic -o ledtest.cpp -impl ledtest.h ledtest.ui
3、vi main.cpp
4、progen –t app.t –o ledtest.pro
注意:修改ledtest.pro文件,把INTERFACES= ledtest.uic 修改为:INTERFACES=
否则提示:
ledtest.o(.text+0x0): In function `ledplayer::ledplayer[not-in-charge](QWidget*, char const*, unsigned)':
: multiple definition of `ledplayer::ledplayer[not-in-charge](QWidget*, char const*, unsigned)'
ledtest.o(.text+0x0): first defined here
ledtest.o(.text+0x660): In function `ledplayer::ledplayer[in-charge](QWidget*, char const*, unsigned)':
: multiple definition of `ledplayer::ledplayer[in-charge](QWidget*, char const*, unsigned)'
ledtest.o(.text+0x660): first defined here
ledtest.o(.text+0xcc0): In function `ledplayer::~ledplayer [not-in-charge]()':
: multiple definition of `ledplayer::~ledplayer [not-in-charge]()'
ledtest.o(.text+0xcc0): first defined here
ledtest.o(.text+0xce0): In function `ledplayer::~ledplayer [in-charge]()':
: multiple definition of `ledplayer::~ledplayer [in-charge]()'
ledtest.o(.text+0xce0): first defined here
ledtest.o(.text+0xd00): In function `ledplayer::~ledplayer [in-charge deleting]()':
: multiple definition of `ledplayer::~ledplayer [in-charge deleting]()'
ledtest.o(.text+0xd00): first defined here
ledtest.o(.text+0xd
: multiple definition of `ledplayer::all_on()'
ledtest.o(.text+0xd
ledtest.o(.text+0xdac): In function `ledplayer::led1_p()':
: multiple definition of `ledplayer::led1_p()'
ledtest.o(.text+0xdac): first defined here
ledtest.o(.text+0xdf0): In function `ledplayer::led2_p()':
: multiple definition of `ledplayer::led2_p()'
ledtest.o(.text+0xdf0): first defined here
ledtest.o(.text+0xe38): In function `ledplayer::led3_p()':
: multiple definition of `ledplayer::led3_p()'
ledtest.o(.text+0xe38): first defined here
ledtest.o(.text+0xe80): In function `ledplayer::all_off()':
: multiple definition of `ledplayer::all_off()'
ledtest.o(.text+0xe80): first defined here
moc_ledtest.o(.text+0x0): In function `ledplayer::className() const':
: multiple definition of `ledplayer::className() const'
moc_ledtest.o(.text+0x0): first defined here
moc_ledtest.o(.data+0x0): multiple definition of `ledplayer::metaObj'
moc_ledtest.o(.data+0x0): first defined here
moc_ledtest.o(.text+0xc): In function `ledplayer::initMetaObject()':
: multiple definition of `ledplayer::initMetaObject()'
moc_ledtest.o(.text+0xc): first defined here
moc_ledtest.o(.text+0xf0): In function `ledplayer::staticMetaObject()':
: multiple definition of `ledplayer::staticMetaObject()'
moc_ledtest.o(.text+0xf0): first defined here
moc_ledtest.o(.text+0x70): In function `ledplayer::tr(char const*)':
: multiple definition of `ledplayer::tr(char const*)'
moc_ledtest.o(.text+0x70): first defined here
moc_ledtest.o(.text+0xb0): In function `ledplayer::tr(char const*, char const*)':
: multiple definition of `ledplayer::tr(char const*, char const*)'
moc_ledtest.o(.text+0xb0): first defined here
5、export TMAKEPATH=/tmake 的安装路径(如$TMAKEDIR)/lib/qws/linux-arm-g++
6、tmake –o makefile ledtest.pro
注意:LIBS = $(SUBLIBS) -L/root/arm_qt/qt-
加入-lts表示动态连接tslib库,支持触摸屏。
7、make