分类: C/C++
2011-11-15 08:58:25
QT 4.4.0+Qdevelop编译安装成功
1.0编译触摸屏
tar xvjf tslib-1.0.tar.bz2
mkdir tslib
cd tslib-1.0/
./autogen.sh
./configure --prefix=/home/thinker/work/tslib --host=arm-unknown-linux-gnueabi ac_cv_func_malloc_0_nonnull=yes
make
##若出现sroot/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments
/home/thinker/toolchains/gcc-4.4.6-glibc-2.9/bin/../arm-unknown-linux-gnueabi/sysroot/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments
错误,则修改(GCC4.0以上就会出现这个错误)
vim ./tests/ts_calibrate.c ##修改227和229行的open函数,增加第三个参数
make install-strip
vim ../tslib/etc/ts.conf ##去除module_raw input前的#号,并且要顶格
2.1 QT安装
tar xvjf qt-embedded-linux-opensource-src-4.4.0.tar.bz2 -C /home/thinker/work/
cp -rf qt-embedded-linux-opensource-src-4.4.0/ qt-embedded-linux-opensource-src-4.4.0_arm
cp -rf qt-embedded-linux-opensource-src-4.4.0/ qt-embedded-linux-opensource-src-4.4.0_x86
2.1.1 编译QT-x11
tar xjvf qt-x11-opensource-src-4.4.0.tar.bz2 -C /home/thinker/work/
cd qt-x11-opensource-src-4.4.0/
./configure -prefix /home/thinker/work/QT/QT-4.4.0 -no-largefile -no-mmx -no-3dnow -no-sse -no-sse2 -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -no-openssl -no-webkit -no-svg -no-phonon -no-opengl -no-sm ##(加上-no-svg参数会出错)
make -j4
make -j4 install
2.1.2 编译qvfb
cd tools/qvfb/
make
##错误x11keyfaker.cpp:50:34: error: X11/extensions/XTest.h: 没有那个文件或目录
##解决办法:
##sudo apt-get install xorg-dev
##将../../bin/qvfb 拷贝到 ~/work/QT/ QT-4.4.0_x86/bin下面##此步骤放在2.2.1之后
cp ../../bin/qvfb ~/work/QT/QT-4.4.0_x86/bin
2.2.1编译嵌入式x86 Qt库
cd ~/wok/qt-embedded-linux-opensource-src-4.4.0_x86/
./configure -prefix /home/thinker/work/QT/QT-4.4.0_x86 -release -shared -no-largefile -no-mmx -no-3dnow -no-sse -no-sse2 -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -no-openssl -no-webkit -no-phonon -no-opengl -no-sm -xplatform qws/linux-x86-g++ -embedded x86 -little-endian -qt-freetype -depths 8,16,18,24,32 -qt-gfx-qvfb -no-gfx-transformed -no-gfx-multiscreen -no-gfx-vnc -no-gfx-linuxfb -qt-kbd-tty -qt-kbd-usb -qt-kbd-qvfb -qt-mouse-pc -qt-mouse-qvfb -no-glib
make -j4
make -j4 install
2.3.1 编译嵌入式arm Qt库(要修改两个错误)
cd ~/work/qt-embedded-linux-opensource-src-4.4.0_arm/
./configure -prefix /home/thinker/work/QT/QT-4.4.0_arm -release -shared -no-largefile -no-mmx -no-3dnow -no-sse -no-sse2 -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -no-openssl -no-webkit -no-phonon -no-opengl -no-sm -xplatform qws/linux-arm-g++ -embedded arm -little-endian -qt-freetype -depths 8,16,18,24,32 -qt-gfx-qvfb -no-gfx-transformed -no-gfx-multiscreen -no-gfx-vnc -qt-gfx-linuxfb -qt-kbd-tty -qt-kbd-usb -qt-kbd-qvfb -qt-mouse-qvfb -no-glib -qt-mouse-tslib -I/home/thinker/work/tslib/include -L/home/thinker/work/tslib/lib
make -j5
make -j5 install
3.1 设置环境变量
3.1.1 设置qt-x11环境变量
vim setenv.sh
##添加如下内容:
PATH=/home/thinker/work/QT/QT-4.4.0/bin:$PATH
LD_LIBRARY_PATH=/home/thinker/work/QT/QT-4.4.0/lib:$LD_LIBRARY_PATH
##保存到~/work/QT/QT-4.4.0 退出
3.2.1 设置qt-embedded-x86环境变量
vim setenv.sh
##添加如下内容:
QTEDIR=/home/thinker/work/QT/QT-4.4.0_x86
PATH=/home/thinker/work/QT/QT-4.4.0_x86/bin:$PATH
LD_LIBRARY_PATH=/home/thinker/work/QT/QT-4.4.0_x86/lib:$LD_LIBRARY_PATH
##保存到~/work/QT/QT-4.4.0_x86 退出
3.3.1 设置qt-embedded-arm环境变量
vim setenv.sh
##添加如下内容:
QTEDIR=/home/thinker/work/QT/QT-4.4.0_arm
PATH=/home/thinker/work/QT/QT-4.4.0_arm/bin:$PATH
LD_LIBRARY_PATH=/home/thinker/work/QT/QT-4.4.0_arm/lib:$LD_LIBRARY_PATH
##保存到~/work/QT/QT-4.4.0_arm 退出
##增加可执行权限
chmod +x setenv.sh
4.1.1 测试qvfb
cd ~/work/QT/QT-4.4.0_x86
source setenv.sh
cd demos/embedded/embeddedsvgviewer/
qvfb -width 320 -height 240 &
##此后会出现一个黑色的框
./embeddedsvgviewer -qws
##黑色框里面出现svgviewer例子表明测试成功
5.1.1 安装Qdevelop for Qt4
##下载链接http://biord-software.org/downloads/qdevelop-v0.28.tar.gz
tar xvzf ./work/QT/qdevelop-v0.28.tar.gz -C ./work/
cd work/qdevelop-v0.28/
source ../QT/QT-4.4.0/setenv.sh
lrelease Qdevelop.pro
qmake
make
sudo make install
qdevelop ##启动qdevelop之后出现环境变量出错
##解决办法:去掉/home/thinker/work/QT/QT-4.4.0/bin/qmake-qt4后面的”-qt4”
##同理:去掉linguist-qt4、lupdate-qt4、lrelease-qt4、designer-qt4、assistant-qt4后面的”-qt4”
##启动后编辑Tools-Options-General下面的project、plugins、include、doc
##目录分别为:
##/home/thinker/work/QT/project/
##/home/thinker/work/QT/QT-4.4.0/plugins/
##/home/thinker/work/QT/QT-4.4.0/include/
##/home/thinker/work/QT/QT-4.4.0/doc/