arm-linux-gcc编译qt库

arm-linux-gcc编译qt库

   用g++编译qt库我用过两次,第一次我稀里糊涂的安装好了,路经也改得差不多,最后忘了是什么错误了,反正发现是没有make install,安装后在/usr/local/下面有一个Trolltech文件夹。第二次又出现问题,不知道在哪里修改路经了,在网上一查可以在两个文件里修改,一个是当前用户的.bashrc文件里,直接执行vi .bashrc即可,另外一个文件便是etc下面的profile文件。区别就是etc下面是全局修改,对任何用户都是升效的,头说最后不要在里面修改。插入一点说明就是,有些文件你ls后看不见,用ls -a就可以啦,命令意思自己查找一下。

 添加路经的内容如下:
export QTDIR=/home/elaine/arm-qte-4.7.0/qte
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export PATH=$QTDIR/bin:$PATH
export QMAKESPEC=$QTDIR/mkspecs/qws/linux-arm-g++
 修改好.bashrc好后,便按照解压后arm-qte-4.7.0-20101105.tar.gz  里面的build-all写的步骤进行操作,步骤如下:
rm -fr qt-everywhere-opensource-src-4.7.0
rm -fr /usr/local/Trolltech/QtEmbedded-4.7.0-arm

tar xfvz qt-everywhere-opensource-src-4.7.0.tar.gz
cd qt-everywhere-opensource-src-4.7.0
echo yes | ./configure -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

make && make install

cd /usr/local/Trolltech/QtEmbedded-4.7.0-arm

我进行到./configure那步就出现问题了,错误如下:
./configure -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

   The specified system/compiler is not supported:

      /home/elaine/arm-qte-4.7.0/qt-everywhere-opensource-src-4.7.0/mkspecs//home/elaine/arm-qte-4.7.0/qte/mkspecs/qws/linux-arm-g++

   Please see the README file for a complete list.

elaine@ubuntu:~/arm-qte-4.7.0/qt-everywhere-opensource-src-4.7.0$ ./configure
Which edition of Qt do you want to use ?

Type 'c' if you want to use the Commercial Edition.
Type 'o' if you want to use the Open Source Edition.

o


   The specified system/compiler is not supported:

      /home/elaine/arm-qte-4.7.0/qt-everywhere-opensource-src-4.7.0/mkspecs//home/elaine/arm-qte-4.7.0/qte/mkspecs/qws/linux-arm-g++

   Please see the README file for a complete list.

这里面反映的问题便是我路经里面有个修改,解压 qt-everywhere-opensource-src-4.7.0.tar.gz后,产生的文件名与我在路经里面写的不一样,我把解压后的文件名修改为qte,这样就与我路经里面一样了。
我又重复./configure命令,这时又出现问题,提示如下:
This is the Qt for Embedded Linux Open Source Edition.

You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
You are also licensed to use this software under the terms of
the GNU General Public License (GPL) versions 3.

Type '3' to view the GNU General Public License version 3.
Type 'L' to view the Lesser GNU General Public License version 2.1.
Type 'yes' to accept this license offer.
Type 'no' to decline this license offer.

Do you accept the terms of either license? yes

Creating qmake. Please wait...
g++ arm-linux-g++ -c -o project.o -pipe -DQMAKE_OPENSOURCE_EDITION -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -I/home/elaine/arm-qte-4.7.0/qte/include -I/home/elaine/arm-qte-4.7.0/qte/include/QtCore -I/home/elaine/arm-qte-4.7.0/qte/src/corelib/global -I/home/elaine/arm-qte-4.7.0/qte/src/corelib/xml -I/home/elaine/arm-qte-4.7.0/qte/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/home/elaine/arm-qte-4.7.0/qte/mkspecs/qws/linux-arm-g++ -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT  project.cpp
make: g++: Command not found
make: *** [project.o] Error 127

这里反映的是g++没有安装,如是我安装g++,命令貌似是sudo apt-get install g++,这个大家自己查查吧。
安装好后,我以为是成功了,现实再次让我失望,这次出现的错误是:
Creating qmake. Please wait...
g++ arm-linux-g++ -c -o project.o -pipe -DQMAKE_OPENSOURCE_EDITION -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -I/home/elaine/arm-qte-4.7.0/qte/include -I/home/elaine/arm-qte-4.7.0/qte/include/QtCore -I/home/elaine/arm-qte-4.7.0/qte/src/corelib/global -I/home/elaine/arm-qte-4.7.0/qte/src/corelib/xml -I/home/elaine/arm-qte-4.7.0/qte/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/home/elaine/arm-qte-4.7.0/qte/mkspecs/qws/linux-arm-g++ -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT  project.cpp
g++: arm-linux-g++: No such file or directory
make: *** [project.o] Error 1
这个问题,我无语了,我看了看mkspecs/qws里面有linux-arm-g++啊,我没辙了。还是老大厉害啊,帮我看了看,然后敲了几行命令,
echo $QMAKESPEC
export QMAKESPEC=
echo $QMAKESPEC
这里是让路经QMAKESPEC置空,我原来操作是把路径的最后一行注释掉的,并且让文件生效,但是没有效果,老大给我解释了这和置空的区别,但是我还是没有明白,太笨啦,他出差了,回来再问问他吧!
修改后终于可以./configure了,然后make,make install。这里老大提示我要sudo make install。说是要copy什么东西的,这里我也没明白,先这样吧,以后再问呗。
make install后,/usr/loacal里面就会出现Trolltech文件了,里面有好多例子的,在/usr/local/Trolltech/QtEmbedded-4.7.0-arm/examples/里面,这里我对里面的例子用了qmake,然后make ,错误提示如下:
elaine@ubuntu:/usr/local/Trolltech/QtEmbedded-4.7.0-arm/examples/network$ qmake
Failure to open file: /usr/local/Trolltech/QtEmbedded-4.7.0-arm/examples/network/Makefile
Unable to generate makefile for: /usr/local/Trolltech/QtEmbedded-4.7.0-arm/examples/network/network.pro
原因是权限不对,用ls -l查看,都是在root下的,用sudo 加在qmake前面就可用了。
编译之后,生成的文件并不是arm里面能跑的二进制文件,有点问题,先研究到这里,,明天继续吧
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值