ubuntu10.10编译TQ2440的x86-qtopia-2.2.0具体问题总结及原因分析

转:

http://blog.csdn.net/zyxlinux888/article/details/6705481

http://www.cnblogs.com/liu_xf/archive/2011/05/03/2033174.html

 

 

 

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 --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/maxim/arm-lite/install-4.3-arm-none-linux-gnueabi-lite/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/maxim/arm-lite/install-4.3-arm-none-linux-gnueabi-lite/arm-none-linux-gnueabi/bin
Thread model: posix
gcc version 4.3.3 (Sourcery G++ Lite 2009q1-176)

zyx@zyx:/opt/EmbedSky$ arm-linux-gcc -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 --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/maxim/arm-lite/install-4.3-arm-none-linux-gnueabi-lite/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/maxim/arm-lite/install-4.3-arm-none-linux-gnueabi-lite/arm-none-linux-gnueabi/bin
Thread model: posix
gcc version 4.3.3 (Sourcery G++ Lite 2009q1-176) 
zyx@zyx:/opt/EmbedSky$

但是编译的时候就是找不到交叉编译器,这让我很费解;后来在看到网上说有可能是权限不足,在根用户下编译时可以找到g++.这样“configure: error: C compiler cannot create executables
See `config.log' for more details.make: *** No targets specified and no makefile found.  Stop.”的错误也迎刃而解。

解决办法:使用根用户重新编译。
zyx@zyx:/opt/EmbedSky/Qte$ su
Password: 
root@zyx:/opt/EmbedSky/Qte# ./arm-qtopia-2.2.0-konqueror_build

4.编译错误:
configure: error: Qt (>= Qt 2.2.2) (headers and libraries) not found. Please check your installation!
For more details about this problem, look at the end of config.log.

原因:出现此类错有可能是下面讲到的第二大类编译错误第10个错误,但是并不一定都能解决问题。有时是用户权限问题,改成根用户重新编译即可。

解决办法:
zyx@zyx:/opt/EmbedSky/Qte$ su
Password: 
root@zyx:/opt/EmbedSky/Qte# ./x86-qtopia-2.2.0-konqueror_build

5.编译错误:
Qtopia data directory is not owned by user 0:/tmp/qtopia-0

原因:权限不足。
解决办法:zyx@zyx:~$ sudo chown root:root /tmp/qtopia-0 然后重启即可。
该类型错误(未验证):
(1)编译错误:如果运行./qtopia.sh 后提示找不到库文件.解决办法:请从编译器目录下查找,并拷贝到开发板/mnt/yaffs/lib 中,然后重启。

(2)编译错误:can’t open framebuffer device /dev/fb0 解决办法:执行命令:ln –sf /dev/fb/0 /dev/fb0,然后重启。

(3)编译错误:Qt/Embedded data directory is not owned by user 0:/tmp/qtembedded-0 解决办法:执行命令:chown root:root /tmp/qtembedded-0,然后重启。


二、因缺少类库或安装包不全出现编译错误的解决办法:
1.编译错误:
make[1]: Entering directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/src'
g++  -c -I/usr/X11R6/include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I/usr/X11R6/include -pipe -O2 -Wall -W -DNO_DEBUG -fPIC -DQT_BUILTIN_GIF_READER=0 -DQT_NO_IMAGEIO_JPEG -DQT_NO_IMAGEIO_MNG -DQT_NO_SM_SUPPORT -DQT_NO_XKB  -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/src/3rdparty/zlib -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/src/3rdparty/libpng  -I3rdparty/kernel -I3rdparty/tools -o tmp/release-shared-linux-g++/3rdparty/kernel/qmotifdnd_x11.o 3rdparty/kernel/qmotifdnd_x11.cpp
3rdparty/kernel/qmotifdnd_x11.cpp:80:22: error: X11/Xlib.h: No such file or directory
............
3rdparty/kernel/qmotifdnd_x11.cpp:902: error: ‘struct DndData’ has no member named ‘time’
make[1]: *** [tmp/release-shared-linux-g++/3rdparty/kernel/qmotifdnd_x11.o] Error 1
make[1]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/src'

原因:
缺少x11/xlib.h,安装libx11-dev即可解决:

解决办法:
zyx@zyx:~$ sudo apt-get install libx11-dev

2.编译错误:
make[1]: Entering directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/src'
g++  -c -I/usr/X11R6/include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I/usr/X11R6/include -pipe -O2 -Wall -W -DNO_DEBUG -fPIC -DQT_BUILTIN_GIF_READER=0 -DQT_NO_IMAGEIO_JPEG -DQT_NO_IMAGEIO_MNG -DQT_NO_SM_SUPPORT -DQT_NO_XKB  -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/src/3rdparty/zlib -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/src/3rdparty/libpng  -I3rdparty/kernel -I3rdparty/tools -o tmp/release-shared-linux-g++/kernel/qpsprinter.o kernel/qpsprinter.cpp
In file included from kernel/qpsprinter.cpp:97:
kernel/qt_x11.h:83:34: error: X11/extensions/shape.h: No such file or directory
In file included from kernel/qpsprinter.cpp:75:
kernel/qimage.h: In member function ‘int QImageTextKeyLang::operator<(const QImageTextKeyLang&) const’:
kernel/qimage.h:58: warning: suggest parentheses around ‘&&’ within ‘||’
make[1]: *** [tmp/release-shared-linux-g++/kernel/qpsprinter.o] Error 1
make[1]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/src'

原因:
缺少X11/extensions/shape.h,安装x11proto-xext-dev即可解决

解决办法:
zyx@zyx:~$ sudo apt-get install x11proto-xext-dev

3.编译错误:
make[1]: Entering directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/tools/designer/uic'
g++ -L/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/lib -Wl,-rpath,/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/lib   -o /opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/bin/uic uic.o ../shared/widgetdatabase.o ../shared/domtool.o ../integration/kdevelop/kdewidgets.o   -lqt 
/usr/bin/ld: cannot find -lqt
collect2: ld returned 1 exit status
make[1]: *** [/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/bin/uic] Error 1
make[1]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/tools/designer/uic'

原因:缺少lqt,安装libqt3-mt-dev即可解决

解决办法:
zyx@zyx:~$ sudo apt-get install libqt3-mt-dev

4.编译错误:
/usr/bin/ld: cannot find -lXmu
collect2: ld returned 1 exit status
make[2]: *** [../lib/libqt-mt.so.3.3.5] Error 1
make[2]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/dqt/src'
make[1]: *** [sub-src] Error 2
make[1]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/dqt'

原因:缺少lXmu,安装libXmu-dev即可解决

解决办法:
zyx@zyx:~$ sudo apt-get install libXmu-dev

5.编译错误:
/usr/bin/ld: cannot find -luuid
/usr/bin/ld: cannot find -lqte
collect2: ld returned 1 exit status
make[5]: *** [../../../lib/libqpe.so.1.5.3] Error 1
make[5]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src/libraries/qtopia'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src/libraries/qtopia'
make[3]: *** [sub-libraries-qtopia] Error 2
make[3]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src'
make[2]: *** [install] Error 2
make[2]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia'
 done !
cp: cannot create regular file `qtopia/image/opt/Qtopia/lib/fonts/': No such file or directory
 done !
the konqueror directory is already !

原因:缺少luuid,安装uuid-dev即可解决

解决办法:
zyx@zyx:~$ sudo apt-get install uuid-dev

注:以下编译错误解决办法未验证。
6.编译错误:C compiler cannot create executables,
解决办法:sudo apt-get install gcc libc6-dev

7.编译错误:checking for C compiler default output... configure: error: C compiler cannot create executables
解决办法:sudo apt-get install libc6-dev

8.编译错误:configure: error: C++ preprocessor "/lib/cpp" fails sanity check
原因:gcc的组件没装全
解决办法:apt-get install build-essential

9.编译错误: Can't find X includes. Please check your installation and add the correct paths!
原因:没有X的包含文件
解决办法:安装xlibs-dev即可

10.编译错误: Qt (>= Qt 3.0) (headers and libraries) not found. Please check your installation!
原因:查找提供qt的lib&&headers的软件包,并安装之
解决办法:apt-get install libqt3-headers libqt3-mt-dev

11.编译错误:in the prefix, you've chosen, are no KDE headers installed. This will fail.
So, check this please and use another prefix!
which basically means its going to want to install a lot of KDE specific packages to work. This 'configure:error'
is due to it expecting you to be running KDE and again refers to some 'headers'.

原因:install a KDE application in a Gnome environment。

解决办法:
sudo apt-get update
sudo apt-get install kdelibs4-dev kdelibs4c2a

12.编译错误:./admin/cvs.sh: 585: autoconf: not found
解决办法:apt-get install autoconf

13.编译错误: *** GTK >= 2.4.0 not installed! ***
原因:没装GTK
解决办法:apt-get build-dep gedit

14.编译错误:heching for gtk-config... no
checking for GTK - version = 1.2.0... no
*** The gtk-config script installed by GTK could not be found
*** If GTK was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GTK_CONFIG enviroment variable to the
*** full path to gtk-config.
configure: error: Cannot find GTK: Is gtk-config in path?
解决办法:sudo apt-get install libgtk1.2-dev
15.编译问题:eclipse中encoding不支持中文
解决办法:编辑/var/lib/locales/supported.d/local,加一行zh_CN.GBK GBK,执行sudo locale-gen

16.编译办法错误:gnome.h: No such file or directory No package 'libpanelapplet-2.0' found
解决:sudo apt-get install gnome-panel

17.编译问题:eva不弹出输入法
解决办法:sudo apt-get install scim-qtimm

18.编译问题:
No package 'gtk+-2.0' found
No package 'gtksourceview-1.0' found
No package 'libgnomeui-2.0' found
No package 'libglade-2.0' found
No package 'libgnomeprintui-2.2' found

解决办法:sudo apt-get install libgtk2.0-dev libgtksourceview-dev libgnomeui-dev libglade2-dev libgnomeprint2.2-dev

19.编译问题:No package 'libpanelapplet-2.0' found
解决办法:sudo apt-get install libpanelappletmm-2.6-dev

三、源代码问题函数错误及权限不足出现编译错误的解决办法:
1.编译错误:
***********************************
********* Build Qt 2 **************
***********************************
make[1]: Entering directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/src'
echo '#include "kernel/qt.h"' >allmoc.cpp
g++  -c -I/usr/X11R6/include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I/usr/X11R6/include -pipe -O2 -Wall -W -DNO_DEBUG -fPIC -DQT_BUILTIN_GIF_READER=0 -DQT_NO_IMAGEIO_JPEG -DQT_NO_IMAGEIO_MNG -DQT_NO_SM_SUPPORT -DQT_NO_XKB  -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/src/3rdparty/zlib -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/src/3rdparty/libpng  -I3rdparty/kernel -I3rdparty/tools -o tmp/release-shared-linux-g++/tools/qmemoryfile_unix.o tools/qmemoryfile_unix.cpp
tools/qmemoryfile_unix.cpp: In member function ‘QMemoryFileData* QMemoryFile::openData(const QString&, int, uint)’:
tools/qmemoryfile_unix.cpp:149: warning: format not a string literal and no format arguments
tools/qmemoryfile_unix.cpp:152: warning: format not a string literal and no format arguments
tools/qmemoryfile_unix.cpp:181: warning: format not a string literal and no format arguments
tools/qmemoryfile_unix.cpp:190: warning: format not a string literal and no format arguments
tools/qmemoryfile_unix.cpp:235: warning: format not a string literal and no format arguments
In file included from /usr/include/fcntl.h:217,
                 from tools/qmemoryfile_unix.cpp:50:
In function ‘int open(const char*, int, ...)’,
    inlined from ‘QMemoryFileData* QMemoryFile::openData(const QString&, int, uint)’ at tools/qmemoryfile_unix.cpp:143:
/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
make[1]: *** [tmp/release-shared-linux-g++/tools/qmemoryfile_unix.o] Error 1
make[1]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/src'

原因:
在Ubuntu 10.10上, gcc会严格检查open()的参数传递,如果第二个参数为O_CREAT的话(就像/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/src/tools/qmemoryfile_unix.cpp的143行这样),必须传入第三个参数mode来提供创建权限。

解决办法:
手动修改/opt/EmbedSky/Qte/x86-qtopia- 2.2.0/qt2/src/tools/qmemoryfile_unix.cpp:第143行

    if (!f)
        f = ::open(tmpFile.latin1(), O_CREAT | O_WRONLY);   
修改为
    if (!f)
        f = ::open(tmpFile.latin1(), O_CREAT | O_WRONLY, 0666);

2.编译错误:
***********************************
********* Build Qtopia ************
***********************************
make[5]: Entering directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src/libraries/qtopia'
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -fPIC  -DQTOPIA_DA
TA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"qpe\" -DQTOPIA_TRTARGET=\"libqpe\" -DQT_NO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/mkspecs/qws/linux-generic-g++ -I. -I../../../include/qtopia/private -I../../../pics/qpe -I../../../include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I../../../include/qtopia/private/ -I.moc/release-shared/ -o .obj/release-shared/qmemoryfile_unix.o qmemoryfile_unix.cpp
qmemoryfile_unix.cpp: In member function ‘QMemoryFileData* QMemoryFile::openData(const QString&, int, uint)’:
qmemoryfile_unix.cpp:149: warning: format not a string literal and no format arguments
qmemoryfile_unix.cpp:187: warning: format not a string literal and no format arguments
qmemoryfile_unix.cpp:232: warning: format not a string literal and no format arguments
In file included from /usr/include/fcntl.h:217,
                 from qmemoryfile_unix.cpp:48:
In function ‘int open(const char*, int, ...)’,
    inlined from ‘QMemoryFileData* QMemoryFile::openData(const QString&, int, uint)’ at qmemoryfile_unix.cpp:141:
/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
make[5]: *** [.obj/release-shared/qmemoryfile_unix.o] Error 1
make[5]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src/libraries/qtopia'

原因:
在Ubuntu 10.10上, gcc会严格检查open()的参数传递,如果第二个参数为O_CREAT的话,必须传入第三个参数mode来提供创建权限。

解决办法:
手动修改/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src/libraries/qtopia/qmemoryfile_unix.cpp:第141行

    if (!f)
        f = ::open(tmpFile.latin1(), O_CREAT | O_WRONLY);   
修改为
    if (!f)
        f = ::open(tmpFile.latin1(), O_CREAT | O_WRONLY, 0666); 

3.编译错误:
make[5]: Entering directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src/libraries/qtopia'
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -fPIC  -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"qpe\" -DQTOPIA_TRTARGET=\"libqpe\" -DQT_NO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/mkspecs/qws/linux-generic-g++ -I. -I../../../include/qtopia/private -I../../../pics/qpe -I../../../include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I../../../include/qtopia/private/ -I.moc/release-shared/ -o .obj/release-shared/vobject.o backend/vobject.cpp
backend/vobject.cpp: In function ‘VObject* addGroup(VObject*, const char*)’:
backend/vobject.cpp:419: error: invalid conversion from ‘const char*’ to ‘char*’
backend/vobject.cpp: In function ‘void writeEncString(OFile*, const char*, bool)’:
backend/vobject.cpp:1111: warning: suggest parentheses around ‘&&’ within ‘||’
backend/vobject.cpp: In function ‘bool includesUnprintable(VObject*, bool)’:
backend/vobject.cpp:1168: warning: suggest parentheses around ‘&&’ within ‘||’
backend/vobject.cpp:1169: warning: suggest parentheses around ‘&&’ within ‘||’
make[5]: *** [.obj/release-shared/vobject.o] Error 1
make[5]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src/libraries/qtopia'

原因:函数返回值类型不匹配

解决方法:
修改/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src/libraries/qtopia/backend/vobject.cpp:第419行

   char *dot = strrchr(g,'.');
修改为
   char *dot = (char*)strrchr(g,'.');
4.编译错误:
make[6]: Entering directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src/plugins/codecs/wavplugin'
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -fPIC  -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"wavplugin\" -DQTOPIA_TRTARGET=\"libwavplugin\" -DQT_NO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/mkspecs/qws/linux-generic-g++ -I. -I../../../3rdparty/libraries/gsm -I../../../../include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I.ui/release-shared/ -I.moc/release-shared/ -o .obj/release-shared/wavplugin.o wavplugin.cpp
wavplugin.cpp: In member function ‘virtual bool WavPlugin::isFileSupported(const QString&)’:
wavplugin.cpp:435: error: invalid conversion from ‘const char*’ to ‘char*’
make[6]: *** [.obj/release-shared/wavplugin.o] Error 1
make[6]: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src/plugins/codecs/wavplugin'

原因:函数返回值类型不匹配

解决方法:
修改/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src/plugins/codecs/wavplugin/wavplugin.cpp:第435行

    char *ext = strrchr( path.latin1(), '.' );
修改为
    char *ext = (char*)strrchr( path.latin1(), '.' );

5.编译错误(此为arm编译脚本运行时出现的错误):
In function ‘open’,
    inlined from ‘main’ at ts_calibrate.c:230:
/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
In function ‘open’,
    inlined from ‘main’ at ts_calibrate.c:232:
/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments

原因:
在Ubuntu 10.10上, gcc会严格检查open()的参数传递,如果第二个参数为O_CREAT的话,必须传入第三个参数mode来提供创建权限。

解决方法:
确定ts_calibrate.c的位置:
root@zyx:/opt/EmbedSky/Qte# locate ts_calibrate.c
/opt/EmbedSky/Qte/arm-qtopia-2.2.0/tslib-1.4.1/tests/ts_calibrate.c

修改/opt/EmbedSky/Qte/arm-qtopia-2.2.0/tslib-1.4.1/tests/ts_calibrate.c:第230行

   cal_fd = open (calfile, O_CREAT | O_RDWR);
修改为
   cal_fd = open (calfile, O_CREAT | O_RDWR,0666);

修改/opt/EmbedSky/Qte/arm-qtopia-2.2.0/tslib-1.4.1/tests/ts_calibrate.c:第232行

   cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR);
修改为
   cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR,0666);

posted @ 2013-11-09 16:51  摩斯电码  阅读(786)  评论(0编辑  收藏  举报