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);
ubuntu10.10编译TQ2440的x86-qtopia-2.2.0具体问题总结及原因分析的更多相关文章
- ubuntu10.10编译TQ2440的x86-qtopia-2.2.0编译问题解决精简版
转:http://blog.csdn.net/zyxlinux888/article/details/6705480 操作:1.要安装系统缺失的类库和安装包(有些是非必须的):zyx@zyx:/$ s ...
- ubuntu10.04编译安装LAMP
ubuntu10.04编译安装LAMP以及简单wordpress的使用 : http://linuxme.blog.51cto.com/1850814/971631 一.源码安装LAMP 网上有一堆关 ...
- VirtualBox内ubuntu10.10系统和windows7 共享文件夹
材料 virtualbox 4.3.0 ubuntu10.10 window 7 sp1 步骤 1.安装好虚拟机和操作系统,(具体步骤网上有很多) 2.安装虚拟机的增强功能包, 安装完成手动系统重新, ...
- 最新Ubuntu10.10 更新源
Ubuntu10.10这个版本真的很老了,官方N多年前早已不再支持更新软件源了. 目前可用的有中科大镜像更新源. 中科大Ubuntu 10.10源列表: deb http://mirrors.ustc ...
- Ubuntu10.10 安装scim
Ubuntu10.10 上没有找到默认的输入法,所以要安装一个中文输入法,网上好多介绍的,但都 不怎么好用,下面参考http://blog.csdn.net/caodesheng110/article ...
- ubuntu10.10 tftp安装,配置,测试
ubuntu10.10 tftp安装,配置,测试 成于坚持,败于止步 虽然ubuntu/centos/redhat都是linux,但是内核其中存在一定的修改,所以对于tftp服务器的安装存在不同的命令 ...
- ubuntu10.10和windows双系统启动顺序的修改
我想大部分童鞋装ubuntu的时候,硬盘上的windows肯定还是保留着的,启动电 脑时可以选择,想进windows就进windows,想进ubuntu就进ubuntu.但装完ubuntu后,它默认启 ...
- ubuntu10.10安装使用vnc
原文发表于:2010-12-15转载至cu于:2012-07-21 搭安全试验的环境,在vmware上安装了ubuntu10.10(大学的时候用过,最早用的好像是6系列吧).安装好后想用远程桌面控制, ...
- ubuntu10.10手工安装jdk1.6
声明:以下操作是在root用户下操作. 一.下载JDK首先,在Oracle的官网上下载JDK.http://www.oracle.com/technetwork/java/javase/downloa ...
随机推荐
- Android记事本开发01
今天: 学习一下Android的基本知识,了解一下记事本开发大概需要哪些知识. 昨天: 无 遇到的问题:
- 【bzoj3325】[Scoi2013]密码 逆模拟Manacher
题目描述 给出一个只包含小写字母的字符串的长度.以每一个字符为中心的最长回文串长度.以及以每两个相邻字符的间隙为中心的最长回文串长度,求满足条件的字典序最小的字符串. 输入 输入由三行组成.第一行仅含 ...
- 【bzoj3561】DZY Loves Math VI 莫比乌斯反演
题目描述 给定正整数n,m.求 输入 一行两个整数n,m. 输出 一个整数,为答案模1000000007后的值. 样例输入 5 4 样例输出 424 题解 莫比乌斯反演 (为了方便,以下公式默认$ ...
- BZOJ2631 tree 【LCT】
题目 一棵n个点的树,每个点的初始权值为1.对于这棵树有q个操作,每个操作为以下四种操作之一: + u v c:将u到v的路径上的点的权值都加上自然数c: - u1 v1 u2 v2:将树中原有的边( ...
- 命令__cp、scp(Secure Copy)
cp命令:区别:硬链接原文件&链接文件公用一个inode号,说明他们是同一个文件,而软链接原文件&链接文件拥有不同的inode号,表明他们是两个不同的文件: 在文件属性上软链接明确写出 ...
- eclipse快捷键及各种设置
1.提示键配置一般默认情况下,Eclipse ,MyEclipse 的代码提示功能是比Microsoft Visual Studio的差很多的,主要是Eclipse ,MyEclipse本身有很多选项 ...
- idea创建maven项目需要注意的问题
idea创建maven项目之后,我从deployment中看到报部署错误的问题,下图是解决问题的办法如下图所示:
- 怎么用tomcat对socket接口的程序进行调试
对socket(套接字)的demo方法大多都是用main方法进行测试的,那如何用tomcat进行测试呢? 这里需要借助一个工具:工具的名字是:Sockettool.exe .下图是该工具的内容.连上监 ...
- TestNG测试执行顺序
1.preserve-order属性,之前一直认为preserve-order属性是控制配置方法的执行顺序的,其实不是,preserve-order主要是控制test下节点classes执行顺序的 例 ...
- Kali安装到移动硬盘或者U盘中~Linux系通用方法(包括Android)
0.1.保证这个服务必须启动(虚拟机服务最好都启动) 0.2.看看U盘接口类型是否对应 1.安装第一步 2.安装第二步,选择kali镜像 3.设置存放位置(上面的名字无所谓,最后不会用它的,虚拟机只是 ...