如何在ubuntu12.04上安装qtopia-2.2.0-friendlyarm (linux strrchr)
1、首先进入管理员状态:sudo su
这时进入管理员状态root@ubuntu:/opt/EmbedSky/Qte#,这个#代表是管理员。如果是在普通用户下是me@ubuntu:~$ ,是$,在普通用户下也会产生许多问题。
2、进入管理员状余旅岩态后的环境变量和普通用户是不一样的,可以echo $PATH看看。添加arm-linux-gcc的环境变量。export PATH=$PATH:/opt/EmbedSkye/4.3.3/bin
3、可能出现的错误:
首先下面这篇文章给了我极大的提示。
在编译x86-qtopia-2.2.0-konqueror_build时里面提到的两个编译错误都会碰到,当然有可能会碰到库不
全的情况,错误会更多。至于哪些库我也记不清了。这是库已镇桐完全安装的情况下的产生的错误的解决办法。在编译天嵌公司的arm-qtopia-2.2.0-
konqueror_build也会碰到类似的错误。解决方法一样。主要就是要更改qmemoryfile_unix.cpp里面的一个函数的参数。
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/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: Error 1
make: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/竖御qtopia/src/libraries/qtopia’
解决办法:
手动修改x86-qtopia-2.2.0/qtopia/src/libraries/qtopia/qmemoryfile_unix.cpp 141行
将
if (!f)
f = ::open(tmpFile.latin1(), O_CREAT | O_WRON);
修改为
if (!f)
f = ::open(tmpFile.latin1(), O_CREAT | O_WRON, 0666);
make: 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: Error 1
make: Leaving directory `/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/src/libraries/qtopia’
解决方法:
修改/x86-qtopia-2.2.0/qtopia/src/libraries/qtopia/backend/vobject.cpp:419行
char *dot = strrchr(g,’.’);
为
char *dot = (char*)strrchr(g,’.’);
4、konqueror的编译
上面是原作者的解决办法。能够成功编译,但是在编译konqueror时就会出现错误 setQpeEnv: not
found。这是无法读取目录下的setQpeEnv脚本所致。首先天嵌的x86-qtopia-2.2.0-konqueror_build也没什么逻
辑上的错误,但是无法读取确实很让人奇怪。
解决办法:在终端的/opt/EmbedSky/Qte/目录下手动执行source ./x86-qtopia-2.2.0/setQpeEnv,再运行 ./x86-qtopia-2.2.0-konqueror_build,就成功编译了。