主题 : 编译x86_qtopia出现问题: 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 7451
精华: 1
发帖: 21
金钱: 230 两
威望: 200 点
综合积分: 62 分
注册时间: 2009-07-15
最后登录: 2017-09-13
楼主  发表于: 2009-08-03 16:29

 编译x86_qtopia出现问题:

管理提醒: 本帖被 arm9home 从 Linux技术交流专区 移动到本区(2009-09-10)
我在编译x86_qtopia的时候,遇到了很多问题。
我用的也是Fedora9.严格按照用户手册来做:
先./build,过程如下:

提示找不到g++,我把/usr/local/arm/4.3.2/arm-none-linux-gnueabi/bin添加到PATH中。再make。

后来又提示,g++:error trying to exec "cc1plus"
我在usr/local/arm/4.3.2/libexec/一个目录下找到,添加到路径。
-------------------------------------------------------------------------------------
前两个还好理解,可能跟系统是否预先安装相关工具集有关。
再make:
出现很多编译的错误,贴出一部分错误信息:
In file included from /opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qstring.h:43,
                 from /opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qgdict.h:43,
                 from /opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qasciidict.h:42,
                 from moc.y:58:
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qcstring.h:50:20: error: string.h: No such file or directory
In file included from moc.y:62:
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qfile.h:44:19: error: stdio.h: No such file or directory
moc.y:63:19: error: ctype.h: No such file or directory
moc.y:65:20: error: stdlib.h: No such file or directory
In file included from moc.y:67:
../tools/qfiledefs_p.h:60:24: error: sys/types.h: No such file or directory
../tools/qfiledefs_p.h:61:23: error: sys/stat.h: No such file or directory
../tools/qfiledefs_p.h:64:21: error: unistd.h: No such file or directory
../tools/qfiledefs_p.h:65:21: error: dirent.h: No such file or directory
../tools/qfiledefs_p.h:67:19: error: fcntl.h: No such file or directory
../tools/qfiledefs_p.h:68:19: error: errno.h: No such file or directory
../tools/qfiledefs_p.h:85:20: error: limits.h: No such file or directory
In file included from /opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qstring.h:43,
                 from /opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qgdict.h:43,
                 from /opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qasciidict.h:42,
                 from moc.y:58:
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qcstring.h: In function 'uint cstrlen(const char*)':
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qcstring.h:87: error: 'strlen' was not declared in this scope
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qcstring.h: In function 'uint qstrlen(const char*)':
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qcstring.h:90: error: 'strlen' was not declared in this scope
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qcstring.h: In function 'char* cstrcpy(char*, const char*)':
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qcstring.h:93: error: 'strcpy' was not declared in this scope
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qcstring.h: In function 'char* qstrcpy(char*, const char*)':
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qcstring.h:96: error: 'strcpy' was not declared in this scope
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qcstring.h: In function 'int cstrcmp(const char*, const char*)':
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qcstring.h:101: error: 'strcmp' was not declared in this scope
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qt2/include/qcstring.h: In function 'int qstrcmp(const char*, const char*)':
......
lex.yy.c: At global scope:
lex.yy.c:105: error: expected initializer before '*' token
lex.yy.c:149: error: ISO C++ forbids declaration of 'FILE' with no type
lex.yy.c:149: error: expected ';' before '*' token
lex.yy.c:231: error: variable or field 'yyrestart' declared void
lex.yy.c:231: error: 'FILE' was not declared in this scope
lex.yy.c:231: error: 'input_file' was not declared in this scope
lex.yy.c:235: error: 'FILE' was not declared in this scope
lex.yy.c:235: error: 'file' was not declared in this scope
lex.yy.c:235: error: expected primary-expression before 'int'
lex.yy.c:235: error: initializer expression list treated as compound expression
lex.yy.c:237: error: 'FILE' has not been declared
lex.yy.c:268: error: expected constructor, destructor, or type conversion before '*' token
In file included from moc.y:1217:
lex.yy.c: In function 'int yylex()':
lex.yy.c:1108: error: 'yyin' was not declared in this scope
lex.yy.c:1109: error: 'stdin' was not declared in this scope
lex.yy.c:1111: error: 'yyout' was not declared in this scope
lex.yy.c:1112: error: 'stdout' was not declared in this scope
lex.yy.c:1116: error: 'yyin' was not declared in this scope
lex.yy.c:1116: error: 'yy_create_buffer' cannot be used as a function
moc.l:82: error: 'stderr' was not declared in this scope
moc.l:82: error: 'fprintf' was not declared in this scope
moc.l:85: error: 'stderr' was not declared in this scope
moc.l:85: error: 'fprintf' was not declared in this scope
moc.l:88: error: 'stderr' was not declared in this scope
moc.l:88: error: 'fprintf' was not declared in this scope
moc.l:91: error: 'stderr' was not declared in this scope
moc.l:91: error: 'fprintf' was not declared in this scope
moc.l:94: error: 'stderr' was not declared in this scope
moc.l:94: error: 'fprintf' was not declared in this scope
moc.l:95: error: 'stderr' was not declared in this scope
moc.l:95: error: 'fprintf' was not declared in this scope
.........
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/dqt/include/qfile.h:74: error: 'FILE' has not been declared
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/dqt/include/qfile.h:102: error: ISO C++ forbids declaration of 'FILE' with no type
/opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/dqt/include/qfile.h:102: error: expected ';' before '*' token
project.cpp: In function 'void qmake_error_msg(const char*)':
project.cpp:63: error: 'stderr' was not declared in this scope
project.cpp:63: error: 'fprintf' was not declared in this scope
project.cpp: In function 'QStringList qmake_mkspec_paths()':
project.cpp:70: error: 'getenv' was not declared in this scope
project.cpp:84: error: 'getenv' was not declared in this scope
project.cpp:100: error: 'getenv' was not declared in this scope
project.cpp: In constructor 'QMakeProject::QMakeProject()':
project.cpp:190: error: 'NULL' was not declared in this scope
project.cpp: In member function 'bool QMakeProject::parse(const QString&, QMap<QString, QStringList>&)':
project.cpp:379: error: 'stdout' was not declared in this scope
project.cpp:379: error: 'fprintf' was not declared in this scope
project.cpp:382: error: 'stdout' was not declared in this scope
project.cpp:382: error: 'fprintf' was not declared in this scope
project.cpp:398: error: 'class QStringList' has no member named 'count'
project.cpp:411: error: 'class QStringList' has no member named 'count'
project.cpp:411: error: 'class QStringList' has no member named 'count'
project.cpp:417: error: 'class QStringList' has no member named 'count'
project.cpp:418: error: no match for 'operator[]' in 'func[3]'
project.cpp:419: error: no match for 'operator[]' in 'func[3]'
project.cpp:421: error: no match for 'operator[]' in 'func[1]'
project.cpp:425: error: no match for 'operator[]' in 'func[2]'
project.cpp: In member function 'bool QMakeProject::read(const QString&, QMap<QString, QStringList>&)':
project.cpp:464: error: 'strcmp' was not declared in this scope
project.cpp:466: error: 'stdin' was not declared in this scope
project.cpp: In member function 'bool QMakeProject::read(uchar)':
project.cpp:563: error: 'stderr' was not declared in this scope
project.cpp:563: error: 'fprintf' was not declared in this scope
project.cpp:579: error: 'stderr' was not declared in this scope
project.cpp:580: error: 'fprintf' was not declared in this scope
project.cpp:594: error: 'stderr' was not declared in this scope
project.cpp:594: error: 'fprintf' was not declared in this scope
project.cpp:611: error: 'stderr' was not declared in this scope
project.cpp:611: error: 'fprintf' was not declared in this scope
project.cpp:642: error: 'stderr' was not declared in this scope
project.cpp:642: error: 'fprintf' was not declared in this scope
project.cpp:677: error: 'getenv' was not declared in this scope
project.cpp:685: error: 'stderr' was not declared in this scope
project.cpp:685: error: 'fprintf' was not declared in this scope
project.cpp: In member function 'bool QMakeProject::isActiveConfig(const QString&, bool, QMap<QString, QStringList>*)':
project.cpp:721: error: 'NULL' was not declared in this scope
project.cpp:723: error: 'malloc' was not declared in this scope
project.cpp:724: error: 'readlink' was not declared in this scope
project.cpp: In member function 'bool QMakeProject::doProjectTest(const QString&, QStringList, QMap<QString, QStringList>&)':
project.cpp:770: error: 'class QStringList' has no member named 'count'
project.cpp:771: error: 'stderr' was not declared in this scope
project.cpp:772: error: 'fprintf' was not declared in this scope
project.cpp:775: error: no match for 'operator[]' in 'args[1]'
project.cpp:778: error: no match for 'operator[]' in 'args[0]'
project.cpp:780: error: 'class QStringList' has no member named 'count'
project.cpp:781: error: 'stderr' was not declared in this scope
project.cpp:782: error: 'fprintf' was not declared in this scope
project.cpp:801: error: 'class QStringList' has no member named 'count'
project.cpp:802: error: 'stderr' was not declared in this scope
project.cpp:803: error: 'fprintf' was not declared in this scope
project.cpp:806: error: 'system' was not declared in this scope
project.cpp:808: error: 'class QStringList' has no member named 'count'
project.cpp:809: error: 'stderr' was not declared in this scope
project.cpp:810: error: 'fprintf' was not declared in this scope
project.cpp:813: error: no match for 'operator[]' in 'args[1]'
project.cpp:814: error: no match for 'operator[]' in 'args[0]'
project.cpp:821: error: 'class QStringList' has no member named 'count'
project.cpp:821: error: 'class QStringList' has no member named 'count'
project.cpp:822: error: 'stderr' was not declared in this scope
project.cpp:823: error: 'fprintf' was not declared in this scope
project.cpp:827: error: no match for 'operator[]' in 'args[0]'
project.cpp:835: error: 'stderr' was not declared in this scope
project.cpp:835: error: 'fprintf' was not declared in this scope
project.cpp:844: error: 'stderr' was not declared in this scope
project.cpp:844: error: 'fprintf' was not declared in this scope
project.cpp:848: error: 'class QStringList' has no member named 'count'
project.cpp:849: error: no match for 'operator[]' in 'args[1]'
project.cpp:851: error: no match for 'operator[]' in 'args[2]'
project.cpp:852: error: no match for 'operator[]' in 'args[1]'
project.cpp:863: error: 'class QStringList' has no member named 'count'
project.cpp:864: error: 'stderr' was not declared in this scope
project.cpp:865: error: 'fprintf' was not declared in this scope
project.cpp:868: error: no match for 'operator[]' in 'args[0]'
project.cpp:868: error: no match for 'operator[]' in 'args[1]'
project.cpp:870: error: 'class QStringList' has no member named 'count'
project.cpp:871: error: 'stderr' was not declared in this scope
project.cpp:872: error: 'fprintf' was not declared in this scope
project.cpp:875: error: no match for 'operator[]' in 'args[0]'
project.cpp:878: error: 'class QStringList' has no member named 'count'
project.cpp:879: error: no match for 'operator[]' in 'args[1]'
project.cpp:880: error: 'class QStringList' has no member named 'count'
project.cpp:884: error: 'stderr' was not declared in this scope
project.cpp:885: error: 'fprintf' was not declared in this scope
project.cpp:901: error: 'getenv' was not declared in this scope
project.cpp:910: error: 'getenv' was not declared in this scope
project.cpp:925: error: 'getenv' was not declared in this scope
project.cpp:948: error: 'printf' was not declared in this scope
project.cpp:949: error: 'exit' was not declared in this scope
project.cpp:970: error: 'stderr' was not declared in this scope
project.cpp:971: error: 'fprintf' was not declared in this scope
project.cpp:979: error: 'stderr' was not declared in this scope
project.cpp:979: error: 'fprintf' was not declared in this scope
project.cpp:1008: error: 'class QStringList' has no member named 'count'
project.cpp:1009: error: 'stderr' was not declared in this scope
project.cpp:1010: error: 'fprintf' was not declared in this scope
project.cpp:1021: error: 'stderr' was not declared in this scope
project.cpp:1021: error: 'fprintf' was not declared in this scope
project.cpp:1024: error: 'exit' was not declared in this scope
project.cpp:1026: error: 'stderr' was not declared in this scope
project.cpp:1027: error: 'fprintf' was not declared in this scope
project.cpp: In member function 'QString QMakeProject::doVariableReplace(QString&, const QMap<QString, QStringList>&)':
project.cpp:1157: error: 'getenv' was not declared in this scope
project.cpp:1180: error: 'class QStringList' has no member named 'count'
project.cpp:1180: error: 'class QStringList' has no member named 'count'
project.cpp:1181: error: 'stderr' was not declared in this scope
project.cpp:1182: error: 'fprintf' was not declared in this scope
project.cpp:1186: error: 'class QStringList' has no member named 'count'
project.cpp:1187: error: no match for 'operator[]' in 'arg_list[1]'
project.cpp:1189: error: 'const class QStringList' has no member named 'count'
project.cpp:1191: error: 'class QStringList' has no member named 'count'
project.cpp:1192: error: no match for 'operator[]' in 'arg_list[2]'
project.cpp:1194: error: 'const class QStringList' has no member named 'count'
project.cpp:1197: error: 'const class QStringList' has no member named 'count'
project.cpp:1200: error: no match for 'operator[]' in 'var'
project.cpp:1204: error: 'class QStringList' has no member named 'count'
project.cpp:1205: error: 'stderr' was not declared in this scope
project.cpp:1206: error: 'fprintf' was not declared in this scope
project.cpp:1208: error: no match for 'operator[]' in 'arg_list[0]'
project.cpp:1240: error: no match for 'operator[]' in 'arg_list[1]'
project.cpp:1268: error: 'class QStringList' has no member named 'count'
project.cpp:1268: error: 'class QStringList' has no member named 'count'
project.cpp:1269: error: 'stderr' was not declared in this scope
project.cpp:1270: error: 'fprintf' was not declared in this scope
project.cpp:1273: error: 'class QStringList' has no member named 'count'
project.cpp:1274: error: no match for 'operator[]' in 'arg_list[1]'
project.cpp:1275: error: 'class QStringList' has no member named 'count'
project.cpp:1276: error: no match for 'operator[]' in 'arg_list[2]'
project.cpp:1277: error: 'class QStringList' has no member named 'count'
project.cpp:1278: error: no match for 'operator[]' in 'arg_list[3]'
project.cpp:1284: error: 'class QStringList' has no member named 'count'
project.cpp:1284: error: 'class QStringList' has no member named 'count'
project
.........................
---------------------------------------------------------------------------------------------------------
不知道大家在编译x86_qtopia时有没有遇到类似的问题,该如何解决呢。


*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-08-03 16:44
提示找不到g++,我把/usr/local/arm/4.3.2/arm-none-linux-gnueabi/bin添加到PATH中。再make。

后来又提示,g++:error trying to exec "cc1plus"
我在usr/local/arm/4.3.2/libexec/一个目录下找到,添加到路径。

这里提示找不到的g++是PC上的编译器,也就是Fedora 9预装的编译器,和交叉编译完全没有关系。你需要做的是通过Package Manager在你的Fedora 9上安装g++编译器;
永远不要在你的PC上把/usr/local/arm/4.3.2/arm-none-linux-gnueabi/bin加到PATH环境变量中,那个目录下的执行档名字和PC上的编译器一样,但产生的却是ARM的执行档,根本无法在PC上运行。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 7451
精华: 1
发帖: 21
金钱: 230 两
威望: 200 点
综合积分: 62 分
注册时间: 2009-07-15
最后登录: 2017-09-13
2楼  发表于: 2009-08-03 21:18
恩。通过下载qt-embedded-2.3.7来编译,也是这个问题。应该是出在g++上。搞不懂我的fedora怎么没有把g++给预装上的。
---------------------------------------
谢谢总版主,每次提问都能得到您的解答和指点,非常感谢您的帮助。