2010年10月28日 星期四

Android與Google Map教學

http://marakana.com/tutorials.html
http://www.designerandroid.com/
http://www.droidnova.com/
http://developer.android.com/resources/samples/index.html

開始學JAVA與Android吧

2010年10月22日 星期五

計算cpu的速度,整數版

bogomis=`cat /proc/cpuinfo | egrep -i '^bogomips' | sed -e 's/^.*: //' -e 's/\..*//'`

2010年10月9日 星期六

Complier Qt 4.6.3軟體

[轉]http://hi.baidu.com/jinshiloveguai/blog/item/ca14360273d6448ae950cd06.html

0:安裝在unbutu上的軟體
apt-get install autoconf(或autoconf2.13)
apt-get install automake
apt-get install libtool


1.解壓qt-everywhere-opensource-src-4.6.3.tar.gz

#tar zxvf qt-everywhere-opensource-src-4.6.3.tar.gz
#mv qt-everywhere-opensource-src-4.6.3 qt-everywhere-opensource-src-4.6.3-arm

解压及编译触摸屏软件

解壓縮及編譯touch Pantslib1.4.tar.gz
A、安装编译过程需用到的程序

B、配置编译
tar xzvf tslib-1.4.tar.gz
cd tslib1.4

#vi build.sh
修改该脚本文件为如下:
#/bin/sh
export CC=arm-linux-gcc
./autogen.sh
echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
./configure --host=arm-linux --cache-file=arm-linux.cache -prefix=/usr/local/tslib

make
make install
推出保存后编译:
#./build.sh

3、编译QT/E库
#cd /usr/local/qt/qt-everywhere-opensource-src-4.6.3-arm

#cp -a /usr/localtslib/lib/* qt-everywhere-opensource-src-4.6.3-arm/lib/
#cp -a /usr/local/tslib/include/ts* qt-everywhere-opensource-src-4.6.3-arm/include/

QTE/configure时的参数
./configure -qt-kbd-tty -qt-gfx-linuxfb -no-gfx-transformed -no-gfx-multiscreen -qt-mouse-pc -no-gfx-qvfb -no-gfx-vnc -qt-kbd-tty -qt-gfx-linuxfb -no-gfx-qvfb -no-gfx-vnc -qt-mouse-tslib -no-glib -prefix /usr/local/Trolltech/QtE4.6.3-arm -embedded arm -release -shared -fast -no-largefile -qt-sql-sqlite -no-qt3support -no-xmlpatterns -no-mmx -no-3dnow -no-sse -no-sse2 -no-svg -no-webkit -qt-zlib -qt-gif -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -make libs -nomake tools -nomake examples -nomake docs -nomake demo -no-nis -no-cups -no-iconv -no-dbus -no-openssl -xplatform qws/linux-arm-g++ -little-endian -qt-freetype -depths 16,18 -I/usr/local/tslib/include -L/usr/local/tslib/lib

使用4.3.2交叉编译器基本上没出现什么错误,但是使用3.4.6刚开始编译出现了以下错误:text/qfontengine_ft.cpp: In member function `bool QFontEngineFT::init(QFontEngine::FaceId, bool, QFontEngineFT::GlyphFormat)':
text/qfontengine_ft.cpp:696: warning: converting to `int' from `qreal'
{standard input}: Assembler messages:
{standard input}:781: Error: register or shift expression expected -- `orr r3,r2,lsl#16'
{standard input}:792: Error: register or shift expression expected -- `orr r2,r3,lsl#16'
{standard input}:7752: Error: register or shift expression expected -- `orr r3,r0,lsl#16'
{standard input}:7765: Error: register or shift expression expected -- `orr r1,r0,lsl#16'
make[1]: *** [.obj/release-shared-emb-arm/qfontengine_ft.o] 错误 1
make[1]:正在离开目录 `/usr/local/qt/qt-everywhere-opensource-src-4.6

苦思不得其解,最后还是上网查了查,发现解决方法为:

把~/qt-everywhere-opensource-src-4.6.0/src/3rdparty/freetype/include/freetype/config/ftconfig.h 这个文件的第330行改一下

原来是:

"orr %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */

改成:

"orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */

这个问题解决了,删除原来的目录重新解压继续编译,又出现以下错误:../3rdparty/javascriptcore /JavaScriptCore/wtf/Platform.h:298:6: #error "Not supported ARM architecture"
make[1]: *** [obj/release/pcre_compile.o] 错误 1
make[1]:正在离开目录 `/usr/local/qt/qt-everywhere-opensource-src-4.6.3-arm/src/script'
make: *** [sub-script-make_defaulrgefile

解决方法:add a line in your ./configure parameters, such as "-D__ARM_ARCH_5TEJ__" , or whichever architecture definition that suits the platform.
就是在./configure参数后面增加一个"-D__ARM_ARCH_5TEJ__"

所以前面的配置参数应该为./configure -qt-kbd-tty -qt-gfx-linuxfb -no-gfx-transformed -no-gfx-multiscreen -qt-mouse-pc -no-gfx-qvfb -no-gfx-vnc -qt-kbd-tty -qt-gfx-linuxfb -no-gfx-qvfb -no-gfx-vnc -qt-mouse-tslib -no-glib -prefix /usr/local/Trolltech/qte4.6.3-arm -embedded arm -release -shared -fast -no-largefile -qt-sql-sqlite -no-qt3support -no-xmlpatterns -no-mmx -no-3dnow -no-sse -no-sse2 -no-svg -no-webkit -qt-zlib -qt-gif -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -make libs -nomake tools -nomake examples -nomake docs -nomake demo -no-nis -no-cups -no-iconv -no-dbus -no-openssl -xplatform qws/linux-arm-g++ -little-endian -qt-freetype -depths 16,18 -I/usr/local/tslib/include -L/usr/local/tslib/lib -v -D__ARM_ARCH_5TEJ__

继续编译没有什么错误了,然后make install

最后是cp lib和字体,以及设置环境变量。到这里移植先告一段落!