主题 : 求教:arm-qtopia交叉编译问题 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 6629
精华: 2
发帖: 22
金钱: 230 两
威望: 78 点
综合积分: 84 分
注册时间: 2009-06-09
最后登录: 2011-08-15
楼主  发表于: 2009-06-18 00:07

 求教:arm-qtopia交叉编译问题

管理提醒: 本帖被 arm9home 从 Linux技术交流专区 移动到本区(2009-09-10)
基本上是一步步照着手册上的步骤做的,编译X86-qtopia时出了些问题,不过自己上网查资料解决了。但编译arm-qtopia时出错,折腾了好几天都没有解决,希望各位不吝赐教。
错误提示如下:
make[1]: 正在进入目录 `/home/general/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qt2/src'
echo '#include "kernel/qt.h"' >allmoc.cpp
arm-linux-g++  -E -DQT_MOC_CPP -I/home/general/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include  -pipe -DQWS -fno-exceptions -fno-rtti -O2 -Wall -W -DNO_DEBUG -fPIC -DQT_NO_QWS_SNAP -DQT_NO_QWS_VOODOO3 -DQT_NO_QWS_MACH64 -DQT_NO_QWS_MATROX -DQT_NO_QWS_VNC -DQT_NO_QWS_VGA_16 -DQT_NO_QWS_DEPTH_4 -DQT_NO_QWS_DEPTH_8 -DQT_NO_QWS_DEPTH_18 -DQT_NO_QWS_DEPTH_24 -DQT_NO_QWS_VFB -DQT_BUILTIN_GIF_READER=1 -DQT_NO_IMAGEIO_MNG -DQT_NO_SM_SUPPORT -DQT_NO_XKB -DQT_QWS_TSLIB -fno-exceptions  -I/home/general/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qt2/src/3rdparty/zlib -I/home/general/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qt2/src/3rdparty/libpng -I/usr/X11R6/include  -I3rdparty/kernel -I3rdparty/tools >allmoc.h allmoc.cpp
/bin/sh: arm-linux-g++: not found
make[1]: *** [allmoc.cpp] 错误 127
make[1]:正在离开目录 `/home/general/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qt2/src'

需要说明的几点是arm-linux-g++已经导入到环境变量里面了。
general@general-desktop:~/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM$ arm-linux-g++ -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /scratch/julian/lite-respin/linux/src/gcc-4.3/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2008q3-72' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin
Thread model: posix
gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72)

我的环境是Ubuntu9.0.4 ,gcc 版本4.1.3
我按网上的说法将/home/general/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qt2/src目录中的makefile做如下修改
SYSCONF_LINK = arm-linux-gcc
SYSCONF_LINK_SHLIB = arm-linux-gcc
均改为
SYSCONF_LINK = arm-linux-g++
SYSCONF_LINK_SHLIB = arm-linux-g++
但是重新make之后,自动生成的makefile将我修改的内容覆盖。我该怎么改呢?
上网还有一篇博客写道:
      这个是因为make的时候按照/root/qtprofile里的路径搜索arm-linux-g++没有搜索到,解决的方法是在给的资料中/Linuxv7.2/gui/Qt/tooth下的 arm-linux-gcc-3.4.1.tar.bz2解压,会生成一个/usr/local的目录,把local目录下的文件arm拷贝到根目录下的/usr/local/,然后修改环境变量在path的后面添加一个/usr/local/arm/3.4.1/bin,下来source该文件就可以了!!
      但是具体怎么做说的不清楚。请高手指点。
armboy@qq.com
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-06-18 10:54
编译qtopia不需要root权限,你用make的时候是否用了sudo?如果是那样的话,用可能会因为root帐号的shell环境里PATH没有包含arm-linux-g++而导致命令找不到。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 6629
精华: 2
发帖: 22
金钱: 230 两
威望: 78 点
综合积分: 84 分
注册时间: 2009-06-09
最后登录: 2011-08-15
2楼  发表于: 2009-06-18 14:34
是的。我用了sudo 命令。如果我在root帐号的shell中添加arm-linux-g++到PATH能解决这个问题吗?或者我更改arm-qtopia文件夹的执行权限。我先试试哈。谢谢斑竹的帮助。
armboy@qq.com
级别: 新手上路
UID: 6629
精华: 2
发帖: 22
金钱: 230 两
威望: 78 点
综合积分: 84 分
注册时间: 2009-06-09
最后登录: 2011-08-15
3楼  发表于: 2009-06-18 15:03
回头看看,觉得这个错误比较弱智。。。。若不是斑竹一语道破,我不知道得折腾到啥时候。再次感谢!!
得到一个教训,不同的用户是不能共享环境变量的。。。
armboy@qq.com
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2009-06-18 15:49
交叉编译任何软件都不需要root权限,否则后果可能无法预期,特别是你用了sudo make install之后
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
5楼  发表于: 2009-06-18 15:50
得到一个教训,不同的用户是不能共享环境变量的。。。

同一个用户在不同的shell进程里也是不能继承环境变量的
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 6629
精华: 2
发帖: 22
金钱: 230 两
威望: 78 点
综合积分: 84 分
注册时间: 2009-06-09
最后登录: 2011-08-15
6楼  发表于: 2009-06-18 16:07
OK,记下了。谢谢斑竹。
armboy@qq.com