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

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编译qtopia-2.2.0 问题总结及分析相关推荐

  1. ubuntu13.10编译android文件系统4.0.4错误全部解析

    以下是编译Android 4.0.4的常见错误,这些错误的解决办法收录自互联网. Google group有个专门的Android Building组,有兴趣的可以加入. 除了android组解决的错 ...

  2. 新蓝剑java_Ubuntu 8.10 编译安装飞鸽(IPMsg 0.9.6)

    2010-03-24 16:38 | xiedejian ronnie@ronnie-desktop:~/下载/g2ipmsg$ ./configure --prefix=/usr --sysconf ...

  3. 新手XP下硬盘安装ubuntu10.10全程解析

    http://linux.itwaka.com Ubuntu 10.10在2010年10月正式发布,让众多Ubuntu用户都对这款全新的系统充满期望.毕竟,Ubuntu 10.10是Canonical ...

  4. usb3.0 u盘 安装 linux,在16G USB3.0中安装ubuntu10.10成功!U盘功能可用

    折腾了快两天,终于成功的将ubuntu装入U盘,同时能够保持U盘功能,激动ing... 感兴趣的同学可以查看附件.(ps:不会传,现把全文内容附上,说不上原创,不过集合了网上很多的资源,自己稍有发挥. ...

  5. (整理)ubuntu10.10安装低版本的编译器(低版本)(gcc)(ubuntu)

    摘要: ubuntu10.10默认安装的是4.4版本的编译器,现在我们要安装3.4的编译器,可是为什么要安装比默认版本要低的编译器呢,主要是因为要编译x86-qtopia,4.4版本的编译器对语法要求 ...

  6. 详解Ubuntu10.10下Qt连接Mysql数据库

    转载自:http://mobile.51cto.com/symbian-273262.htm 详解Ubuntu10.10下Qt连接Mysql数据库是本文要介绍的内容,很详细的步骤,我们先来看内容. 第 ...

  7. TinyOS 学习第一周-Ubuntu-10.10下安装TinyOS-2.1.1

    1           Ubuntu-10.10下安装TinyOS-2.1.1 1背景:TinyOS主要有三种运行环境: <1> Windows环境: 虚拟机(Oracle VM Visu ...

  8. LAMP(httpd 2.4.1 + mysql-5.5.19 + php-5.3.10)编译安装

    LAMP(httpd 2.4.1+mysql-5.5.19+php-5.3.10)编译安装 一.安装开发包组: yum groupinstall "Development Tools&quo ...

  9. mysql+1.6安装,CentOS 7.0编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14方法

    这篇文章主要介绍了CentOS 7.0编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14方法分享,需要的朋友可以参考下准备篇: 一.配置防火墙,开启80端口.3306端口 Cen ...

最新文章

  1. win11什么时候发布的_2021年初级会计师考试大纲什么时候发布?
  2. 内网能PING通TELNET通不能访问解决
  3. oracle忘记实例名,Oracle的安装和MS SQL Server实例名
  4. 关于oracle数据库的操作的命令
  5. mysql 修改表id值_修改数据库中表的id
  6. 关于考研一些问题的思考2017-12-23
  7. C++--第22课 - 类模板 - 下
  8. 几款好用的滤波器设计软件
  9. 二阶系统响应指标图_自动控制理论_3.3 二阶系统的瞬态响应
  10. jmeter beanshell 之常用的代码
  11. LeetCode 43. 字符串相乘【c++/java详细题解】
  12. SQL注入点判断及万能密码
  13. Bootstrap—解决下拉菜单不弹出问题
  14. 自然可视图是什么意思?
  15. zigbee学习参考(1~42 )
  16. Android:关灯游戏简单闯关
  17. 使用扫码枪识别条形码
  18. hypersion oracle_Oracle收购Hyperion(海波龙)带来的思考与机遇
  19. ibm服务器光模块位置,IBM X3650服务器内部结构拆解一
  20. 经典lamination理论不能精确满足应力的边界条件外文书复合材料力学《Mechanics of C M》

热门文章

  1. layui导入模板数据_实物资产管理软件操作手册(数据接口)
  2. mongodb 查询效率_2020年9个好用的MongoDB 图形化界面工具
  3. python 将实例用作属性_将类实例用作类属性、描述符和属性
  4. java wait方法_java wait方法
  5. mac nginx apache mysql php 一键_Mac 下搭建 apache / nginx+php+mysql
  6. GraphSage模型cora数据集
  7. 深入理解javascript原型和闭包(4)——隐式原型
  8. 二十年编程语言风云,哪款是你的爱豆?
  9. Python实现的导弹跟踪算法,燃!
  10. keil生成hex文件找不到_骚操作!用Python把公众号文章打包成pdf文件,再也不怕找不到了...