linux交叉编译的问题

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
ly_ordos
帖子: 2
注册时间: 2014-06-05 17:11
系统: linux

linux交叉编译的问题

#1

帖子 ly_ordos » 2014-06-05 17:27

root@ly-laptop:~/ly# gcc -lstdc++ -o cyy.out cyy.cpp add.cpp
用上面的指令可以编译




但是交叉编译时就会出现下面的错误,实在不知道是什么原因,求大神指点迷津,谢谢谢谢

root@ly-laptop:~/ly# arm-linux-gcc -lm -o cyy.out cyy.cpp add.cpp elim_burst.c mrelfft.c
cyy.cpp:1: error: stray '\357' in program
cyy.cpp:1: error: stray '\273' in program
cyy.cpp:1: error: stray '\277' in program
cyy.cpp:1: error: stray '#' in program
cyy.cpp:1: error: expected constructor, destructor, or type conversion before '<' token
In file included from cyy.cpp:2:
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:140: error: 'size_t' does not name a type
In file included from cyy.cpp:2:
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:337: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:367: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:471: error: 'size_t' was not declared in this scope
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:471: error: expected ',' or ';' before 'throw'
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:473: error: 'size_t' was not declared in this scope
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:473: error: 'size_t' was not declared in this scope
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:473: error: initializer expression list treated as compound expression
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:474: error: expected ',' or ';' before 'throw'
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:485: error: 'size_t' has not been declared
In file included from /opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:497,
from cyy.cpp:2:
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/alloca.h:33: error: 'size_t' was not declared in this scope
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/alloca.h:33: error: expected ',' or ';' before 'throw'
In file included from cyy.cpp:2:
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:502: error: 'size_t' was not declared in this scope
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:502: error: expected ',' or ';' before 'throw'
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:507: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:507: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:684: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:684: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:689: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:689: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:692: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:692: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:767: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:770: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:774: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:778: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:787: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:791: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:798: error: 'size_t' does not name a type
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:801: error: 'size_t' does not name a type
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:864: error: 'size_t' has not been declared
In file included from cyy.cpp:3:
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:39: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:43: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:52: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:59: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:62: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:66: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:77: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:88: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:96: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:102: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:109: error: 'size_t' does not name a type
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:124: error: 'size_t' does not name a type
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:138: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:184: error: 'size_t' does not name a type
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:188: error: 'size_t' does not name a type
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:225: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:226: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:232: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:235: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:242: error: 'size_t' does not name a type
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:249: error: 'size_t' does not name a type
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:281: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:294: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:298: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:302: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:305: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:335: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:347: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:376: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:379: error: 'size_t' has not been declared
/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/usr/include/string.h:386: error: 'size_t' has not been declared
cyy.cpp: In function 'int main()':
cyy.cpp:99: error: 'FILE' was not declared in this scope
cyy.cpp:99: error: 'fp' was not declared in this scope
cyy.cpp:100: error: unknown escape sequence '\d'
cyy.cpp:104: error: 'fopen' was not declared in this scope
cyy.cpp:106: error: 'printf' was not declared in this scope
cyy.cpp:107: error: 'getchar' was not declared in this scope
cyy.cpp:110: error: 'feof' was not declared in this scope
cyy.cpp:112: error: 'fscanf' was not declared in this scope
cyy.cpp:116: error: 'fclose' was not declared in this scope
cyy.cpp:125: error: 'printf' was not declared in this scope
cyy.cpp:188: error: 'getchar' was not declared in this scope
cyy.cpp: In function 'void shujutiqu()':
cyy.cpp:222: error: 'printf' was not declared in this scope
cyy.cpp: In function 'void jglvbo()':
cyy.cpp:262: error: 'printf' was not declared in this scope
cyy.cpp: In function 'void duanshi()':
cyy.cpp:742: error: 'printf' was not declared in this scope
回复