由于qt4.6.2的类库中没有QtDeclarative模块,所以用
ppacctv的方法
http://www.aiothome.net/read.php?tid-5161.html建立起来的qt4编译环境不能运行QML代码。最新的qt4.7.2中包含对QMl的支持,到诺基亚qt网站
http://qt.nokia.com/downloads/embedded-linux-cpp下载最新qt类库qt-everywhere-opensource-src-4.7.2.tar.gz,解压后用如下参数配置
./configure
-prefix /usr/local/Trolltech/QtEmbedded-4.7.2-arm-static -opensource -confirm-license -debug-and-release
-static -embedded arm -xplatform qws/linux-arm-g++ -depths 16,18,24 -qt-gfx-transformed -fast -optimized-qmake -pch -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -little-endian -host-little-endian -no-qt3support -no-libtiff -no-libmng -no-opengl -no-mmx -no-sse -no-sse2 -no-3dnow -no-openssl -no-webkit -no-phonon -no-nis -no-opengl -no-cups -no-glib -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info -nomake examples -nomake demos -nomake tools -nomake docs -qt-kbd-tty -qt-kbd-linuxinput -qt-mouse-pc -qt-mouse-linuxtp -qt-mouse-linuxinput -qt-mouse-qvfb -qt-mouse-tslib
在mini2440板子现成的的文件系统中没有Qt4.7.2的so文件,所以为了方便配置为静态链接static,在板子上运行时,就不会因找不到哪个so出错了
然后gmake,gmake install。详细编译见
http://www.aiothome.net/read.php?tid-5161.html 然后启动qtcreator找一个QML的例子用刚才的编译器编译链接一下,拿到板子上去运行,但是会出现字体的错误,我的方法是干脆直接拷贝将板子上的/usr/local/Trolltech/QtEmbedded-4.6.3-arm拷贝并在同一目录黏贴为/usr/local/Trolltech/QtEmbedded-4.7.2-arm-static
下面是动态链接:
动态编译,配置参数
./configure
-prefix /usr/local/Trolltech/QtEmbedded-4.7.2-arm-shared -opensource -confirm-license -debug-and-release
-shared -embedded arm -xplatform qws/linux-arm-g++ -depths 16,18,24 -qt-gfx-transformed -fast -optimized-qmake -pch -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -little-endian -host-little-endian -no-qt3support -no-libtiff -no-libmng -no-opengl -no-mmx -no-sse -no-sse2 -no-3dnow -no-openssl -no-webkit -no-phonon -no-nis -no-opengl -no-cups -no-glib -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info -nomake examples -nomake demos -nomake tools -nomake docs -qt-kbd-tty -qt-kbd-linuxinput -qt-mouse-pc -qt-mouse-linuxtp -qt-mouse-linuxinput -qt-mouse-qvfb -qt-mouse-tslib
[ 此帖被shift在2011-07-09 10:27重新编辑 ]