声明:转载请注明出处。
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package.
Tell me:
configure == configure
make == build
make install == install
序:
我这几天编译Qtopia时积累了一些小经验,把编译错误大致分为三类错误:一、因环境变量不起作用及权限不足而导致 二、因缺少类库或安装包不全而导致 三、源代码问题函数错误而导致。
由于编译器版本太高,造成编译Qtopia-2.2.0时,出错很多,但是也只有这样才能够学习到东西,锻炼分析问题,解决问题的能力.但是如果为了节约时间,强烈推荐使用低版本的编译器。
以下为编译x86-qtopia-2.2.0得出经验,编译arm-qtopia-2.2.0时出现的编译错误也可以参考一下对对应内容自行修改。
编译前提:
OS:ubuntu 10.10
GCC:4.3.3
DB:ARM9-TQ2440
SourceCode:Qtopia-2.2.0
首先安装EABI并设置交叉编译器的环境变量:
1、打开环境变量设置文件environment
zyx@zyx:~$ sudo gedit /etc/environment
2、在其中添加":/opt/EmbedSky/4.3.3/bin",修改后为
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/EmbedSky/4.3.3/bin"
3、使修改后的环境变量生效
zyx@zyx:~$ sudo source /etc/environment
一、因环境变量不起作用及权限不足出现编译错误的解决办法:
1.编译错误:
zyx@zyx:~$ sudo ./x86-qtopia-2.2.0-konqueror_build
the qpe program is already !
the konqueror directory is already !
Build konqueror , please wait ...
.: 46: setQpeEnv: not found
原因:配置环境没有起作用。
解决办法:
在x86-qtopia-2.2.0-konqueror_build编译脚本配置文件中
第26行 .setQpeEnv
改成 ./setQpeEnv
重新编译
若不起作用
继续改成 source ./x86-qtopia-2.2.0/setQpeEnv
重新编译
若仍不起作用
就直接将 /opt/EmbedSky/Qte/x86-qtopia-2.2.0/setQpeEnv
的内容 直接copy到此处,再将原来的注释掉
重新编译即可
2.编译错误(此为arm编译脚本运行时出现的错误):
chmod: cannot access `set*Env': No such file or directory
done !
done !
the konqueror directory is already !
Build konqueror , please wait ...
./arm-qtopia-2.2.0-konqueror_build: 58: source: not found
原因:配置环境没有起作用。
解决办法:
在arm-qtopia-2.2.0-konqueror_build编译脚本配置文件中
第25行 source arm-qtopia-2.2.0/setQpeEnv 用#号注释掉
直接将 /opt/EmbedSky/Qte/arm-qtopia-2.2.0/setQpeEnv
的内容 直接copy到此处,重新编译即可。
3.编译错误(此为arm编译脚本运行时出现的错误):
make: arm-linux-g++: Command not found
make: *** [main.o] Error 127
make: arm-linux-g++: Command not found
make: *** [.obj/linux-arm-g++//filebrowser.o] Error 127
make: /opt/EmbedSky/Qte/arm-qtopia-2.2.0/qt2/bin/uic: Command not found
make: *** [settingsdialogbase.h] Error 127
make: arm-linux-g++: Command not found
make: *** [.obj/linux-arm-g++//TEScreen.o] Error 127
./arm-qtopia-2.2.0_build: line 69: cd: arm-qtopia-2.2.0/qtopia/image/opt/Qtopia/lib/fonts/: No such file or directory
mv: cannot stat `helvetica_120_50.qpf': No such file or directory
mv: cannot stat `helvetica_120_50_t5.qpf': No such file or directory
mv: cannot stat `bak_helvetica_120_50_t5.qpf': No such file or directory
mv: cannot stat `bak_helvetica_120_50.qpf': No such file or directory
cp: cannot stat `qtopia/image/opt': No such file or directory
chmod: cannot access `set*Env': No such file or directory
./arm-qtopia-2.2.0-konqueror_build: 55: source: not found
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
configure: error: C compiler cannot create executables
See `config.log' for more details.
make: *** No targets specified and no makefile found. Stop.
原因:安装EABI时已安装了交叉编译器并设置了交叉编译器的环境变量,也能够通过命令找到arm-linux-g++和arm-linux-gcc,如下:
zyx@zyx:/opt/EmbedSky$ arm-linux-g++ -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /scratch/maxim/arm-lite/src-4.3-arm-none-linux-gnueabi-lite/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 --with-specs='%{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables}' --enable-languages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2009q1-176' --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/maxim/arm-lite/install-4.3-arm-none-linux-gnueabi-lite/arm-none-linux-gnueabi/libc --with-gmp=/scratch/maxim/arm-lite/obj-4.3-arm-none-linux-gnueabi-lite/host-libs-2009q1-176-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/maxim/arm-lite/obj-4.3-arm-none-linux-gnueabi-lite/host-libs-2009q1-176-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --di