+ -
当前位置:首页 → 问答吧 → 菜鸟请教各位高手u-boot编译时的问题

菜鸟请教各位高手u-boot编译时的问题

时间:2010-09-08

来源:互联网

我用arm-linux-gcc 3.3.2交叉编译环境编译u-boot1.20时出现了一下问题,以为是编译器版本问题,但是换了高版本跟低版本还是这个问题,实在搞不懂,本人刚刚接触这方面请指教,下面是问题显示:
jiangbei@jiangbei-desktop:/usr/local/arm/u-boot-1.2.0$ make smdk2410_config
Configuring for smdk2410 board...
jiangbei@jiangbei-desktop:/usr/local/arm/u-boot-1.2.0$ make
make: /usr/local/arm/2.95.3/arm-linux-gcc:命令未找到
for dir in tools examples post post/cpu ; do make -C $dir _depend ; done
make[1]: /usr/local/arm/2.95.3/arm-linux-gcc:命令未找到
make[1]: 正在进入目录 `/usr/local/arm/u-boot-1.2.0/tools'
make[1]: 没有什么可以做的为 `_depend'。
make[1]:正在离开目录 `/usr/local/arm/u-boot-1.2.0/tools'
make[1]: /usr/local/arm/2.95.3/arm-linux-gcc:命令未找到
make[1]: 正在进入目录 `/usr/local/arm/u-boot-1.2.0/examples'
/bin/sh: /usr/local/arm/2.95.3/arm-linux-gcc: not found
dirname: 缺少操作数
请尝试执行“dirname --help”来获取更多信息。
/bin/sh: /usr/local/arm/2.95.3/arm-linux-gcc: not found
dirname: 缺少操作数
请尝试执行“dirname --help”来获取更多信息。
make[1]: 没有什么可以做的为 `_depend'。
make[1]:正在离开目录 `/usr/local/arm/u-boot-1.2.0/examples'
make[1]: /usr/local/arm/2.95.3/arm-linux-gcc:命令未找到
make[1]: 正在进入目录 `/usr/local/arm/u-boot-1.2.0/post'
make[1]: 没有什么可以做的为 `_depend'。
make[1]:正在离开目录 `/usr/local/arm/u-boot-1.2.0/post'
make[1]: /usr/local/arm/2.95.3/arm-linux-gcc:命令未找到
make[1]: 正在进入目录 `/usr/local/arm/u-boot-1.2.0/post/cpu'
make[1]: 没有什么可以做的为 `_depend'。
make[1]:正在离开目录 `/usr/local/arm/u-boot-1.2.0/post/cpu'
make -C tools all
make[1]: /usr/local/arm/2.95.3/arm-linux-gcc:命令未找到
make[1]: 正在进入目录 `/usr/local/arm/u-boot-1.2.0/tools'
gcc -Wall -pedantic -idirafter /usr/local/arm/u-boot-1.2.0/include -idirafter /usr/local/arm/u-boot-1.2.0/include2 -idirafter /usr/local/arm/u-boot-1.2.0/include -DTEXT_BASE=0x33F80000 -DUSE_HOSTCC -O -c -o img2srec.o img2srec.c
img2srec.c:56:19: 错误: stdio.h:没有该文件或目录
img2srec.c:57:20: 错误: stdlib.h:没有该文件或目录
img2srec.c:58:19: 错误: ctype.h:没有该文件或目录
img2srec.c:59:20: 错误: string.h:没有该文件或目录
在包含自 img2srec.c:60 的文件中:
/usr/local/arm/u-boot-1.2.0/include/elf.h:43:20: 错误: stdint.h:没有该文件或目录
In file included from img2srec.c:60:
/usr/local/arm/u-boot-1.2.0/include/elf.h:58: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Elf32_Addr’
/usr/local/arm/u-boot-1.2.0/include/elf.h:59: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Elf32_Off’
/usr/local/arm/u-boot-1.2.0/include/elf.h:60: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Elf32_Sword’
/usr/local/arm/u-boot-1.2.0/include/elf.h:61: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Elf32_Word’
/usr/local/arm/u-boot-1.2.0/include/elf.h:62: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Elf32_Half’
/usr/local/arm/u-boot-1.2.0/include/elf.h:123: 错误: expected specifier-qualifier-list before ‘Elf32_Half’
/usr/local/arm/u-boot-1.2.0/include/elf.h:243: 错误: expected specifier-qualifier-list before ‘Elf32_Word’
/usr/local/arm/u-boot-1.2.0/include/elf.h:353: 错误: expected specifier-qualifier-list before ‘Elf32_Word’
/usr/local/arm/u-boot-1.2.0/include/elf.h:403: 错误: expected specifier-qualifier-list before ‘Elf32_Addr’
/usr/local/arm/u-boot-1.2.0/include/elf.h:410: 错误: expected specifier-qualifier-list before ‘Elf32_Addr’
/usr/local/arm/u-boot-1.2.0/include/elf.h:422: 错误: expected specifier-qualifier-list before ‘Elf32_Word’
/usr/local/arm/u-boot-1.2.0/include/elf.h:457: 错误: expected specifier-qualifier-list before ‘Elf32_Sword’
img2srec.c:61:20: 错误: unistd.h:没有该文件或目录
img2srec.c:62:19: 错误: errno.h:没有该文件或目录
img2srec.c:81: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘CHAR’
img2srec.c:82: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘BYTE’
img2srec.c:83: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘WORD’
img2srec.c:84: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘DWORD’
img2srec.c:95: 错误: expected ‘)’ before ‘*’ token
img2srec.c:96: 错误: expected ‘)’ before ‘*’ token
img2srec.c:97: 错误: expected ‘)’ before ‘*’ token
img2srec.c:98: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
img2srec.c:99: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
img2srec.c:100: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
img2srec.c:101: 错误: expected declaration specifiers or ‘...’ before ‘BYTE’
img2srec.c:101: 错误: expected declaration specifiers or ‘...’ before ‘WORD’
img2srec.c:102: 错误: expected declaration specifiers or ‘...’ before ‘WORD’
img2srec.c:102: 错误: expected declaration specifiers or ‘...’ before ‘DWORD’
img2srec.c:103: 警告: 在‘BYTE’的声明中,类型默认为‘int’
img2srec.c:103: 错误: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
img2srec.c:104: 错误: expected declaration specifiers or ‘...’ before ‘DWORD’
img2srec.c:111: 错误: expected ‘)’ before ‘*’ token
img2srec.c:133: 错误: expected ‘)’ before ‘*’ token
img2srec.c:154: 错误: expected ‘)’ before ‘*’ token
img2srec.c:174: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
img2srec.c:184: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
img2srec.c:196: 错误: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
img2srec.c:203: 错误: expected declaration specifiers or ‘...’ before ‘BYTE’
img2srec.c:203: 错误: expected declaration specifiers or ‘...’ before ‘WORD’
img2srec.c: 在函数‘WriteHex’中:
img2srec.c:205: 错误: ‘WORD’未声明 (在此函数内第一次使用)
img2srec.c:205: 错误: (即使在一个函数内多次出现,每个未声明的标识符在其
img2srec.c:205: 错误: 所在的函数内也只报告一次。)
img2srec.c:205: 错误: expected ‘;’ before ‘temp’
img2srec.c:207: 警告: ISO C90 不允许混合使用声明和代码
img2srec.c:209: 错误: ‘pCheckSum’未声明 (在此函数内第一次使用)
img2srec.c:209: 错误: ‘value’未声明 (在此函数内第一次使用)
img2srec.c:210: 错误: ‘temp’未声明 (在此函数内第一次使用)
img2srec.c: 在文件层:
img2srec.c:218: 错误: expected declaration specifiers or ‘...’ before ‘WORD’
img2srec.c:218: 错误: expected declaration specifiers or ‘...’ before ‘DWORD’
img2srec.c:219: 警告: 在‘BYTE’的声明中,类型默认为‘int’
img2srec.c:219: 错误: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
img2srec.c:268: 错误: expected declaration specifiers or ‘...’ before ‘DWORD’
img2srec.c: 在函数‘ConvertELF’中:
img2srec.c:270: 错误: ‘FILE’未声明 (在此函数内第一次使用)
img2srec.c:270: 错误: ‘file’未声明 (在此函数内第一次使用)
img2srec.c:271: 警告: ISO C90 不允许混合使用声明和代码
img2srec.c:273: 错误: ‘BYTE’未声明 (在此函数内第一次使用)
img2srec.c:273: 错误: expected ‘;’ before ‘rxBlock’
img2srec.c:274: 错误: ‘DWORD’未声明 (在此函数内第一次使用)
img2srec.c:274: 错误: expected ‘;’ before ‘loadSize’
img2srec.c:275: 错误: expected ‘;’ before ‘firstAddr’
img2srec.c:276: 错误: expected ‘;’ before ‘loadAddr’
img2srec.c:277: 错误: expected ‘;’ before ‘loadDiff’
img2srec.c:278: 警告: ISO C90 不允许混合使用声明和代码
img2srec.c:280: 错误: ‘getPtr’未声明 (在此函数内第一次使用)
img2srec.c:281: 警告: ISO C90 不允许混合使用声明和代码
img2srec.c:286: 警告: 隐式声明函数‘fopen’
img2srec.c:287: 警告: 隐式声明函数‘fprintf’
img2srec.c:287: 警告: 内建函数 ‘fprintf’ 不兼容的隐式声明
img2srec.c:287: 错误: ‘stderr’未声明 (在此函数内第一次使用)
img2srec.c:287: 警告: 隐式声明函数‘strerror’
img2srec.c:287: 警告: 格式‘%s’需要类型‘char *’,但实参 4 的类型为‘int’
img2srec.c:292: 警告: 隐式声明函数‘fread’
img2srec.c:292: 错误: ‘rxBlock’未声明 (在此函数内第一次使用)
img2srec.c:293: 警告: 隐式声明函数‘ExtractBlock’
img2srec.c:294: 警告: 隐式声明函数‘ExtractWord’
img2srec.c:294: 错误: ‘Elf32_Ehdr’没有名为‘e_type’的成员
img2srec.c:295: 错误: ‘Elf32_Ehdr’没有名为‘e_machine’的成员
img2srec.c:296: 警告: 隐式声明函数‘ExtractLong’
img2srec.c:296: 错误: expected expression before ‘)’ token
img2srec.c:297: 错误: expected expression before ‘)’ token
img2srec.c:298: 错误: expected expression before ‘)’ token
img2srec.c:299: 错误: expected expression before ‘)’ token
img2srec.c:300: 错误: expected expression before ‘)’ token
img2srec.c:301: 错误: ‘Elf32_Ehdr’没有名为‘e_ehsize’的成员
img2srec.c:302: 错误: ‘Elf32_Ehdr’没有名为‘e_phentsize’的成员
img2srec.c:303: 错误: ‘Elf32_Ehdr’没有名为‘e_phnum’的成员
img2srec.c:304: 错误: ‘Elf32_Ehdr’没有名为‘e_shentsize’的成员
img2srec.c:305: 错误: ‘Elf32_Ehdr’没有名为‘e_shnum’的成员
img2srec.c:306: 错误: ‘Elf32_Ehdr’没有名为‘e_shstrndx’的成员
img2srec.c:312: 错误: ‘Elf32_Ehdr’没有名为‘e_type’的成员
img2srec.c:314: 警告: 隐式声明函数‘fclose’
img2srec.c:315: 警告: 内建函数 ‘fprintf’ 不兼容的隐式声明
img2srec.c:320: 警告: 隐式声明函数‘fseek’
img2srec.c:320: 错误: ‘Elf32_Ehdr’没有名为‘e_shoff’的成员
img2srec.c:320: 错误: ‘SEEK_SET’未声明 (在此函数内第一次使用)
img2srec.c:321: 错误: ‘Elf32_Ehdr’没有名为‘e_shnum’的成员
img2srec.c:323: 错误: expected expression before ‘)’ token
img2srec.c:324: 错误: expected expression before ‘)’ token
img2srec.c:325: 错误: expected expression before ‘)’ token
img2srec.c:326: 错误: expected expression before ‘)’ token
img2srec.c:327: 错误: expected expression before ‘)’ token
img2srec.c:328: 错误: expected expression before ‘)’ token
img2srec.c:329: 错误: expected expression before ‘)’ token
img2srec.c:330: 错误: expected expression before ‘)’ token
img2srec.c:331: 错误: expected expression before ‘)’ token
img2srec.c:332: 错误: expected expression before ‘)’ token
img2srec.c:335: 警告: 内建函数 ‘fprintf’ 不兼容的隐式声明
img2srec.c:340: 警告: 隐式声明函数‘strrchr’
img2srec.c:340: 警告: 内建函数 ‘strrchr’ 不兼容的隐式声明
img2srec.c:346: 警告: 隐式声明函数‘BuildSRecord’
img2srec.c:346: 错误: expected expression before ‘)’ token
img2srec.c:347: 警告: 隐式声明函数‘printf’
img2srec.c:347: 警告: 内建函数 ‘printf’ 不兼容的隐式声明
img2srec.c:350: 错误: ‘firstAddr’未声明 (在此函数内第一次使用)
img2srec.c:351: 错误: ‘loadAddr’未声明 (在此函数内第一次使用)
img2srec.c:352: 错误: ‘Elf32_Ehdr’没有名为‘e_shnum’的成员
img2srec.c:353: 错误: ‘struct <anonymous>’没有名为‘sh_type’的成员
img2srec.c:354: 错误: ‘struct <anonymous>’没有名为‘sh_size’的成员
img2srec.c:356: 错误: ‘loadSize’未声明 (在此函数内第一次使用)
img2srec.c:356: 错误: ‘struct <anonymous>’没有名为‘sh_size’的成员
img2srec.c:357: 错误: ‘struct <anonymous>’没有名为‘sh_flags’的成员
img2srec.c:358: 错误: ‘struct <anonymous>’没有名为‘sh_addr’的成员
img2srec.c:359: 错误: ‘loadDiff’未声明 (在此函数内第一次使用)
img2srec.c:359: 错误: ‘struct <anonymous>’没有名为‘sh_offset’的成员
img2srec.c:362: 错误: ‘struct <anonymous>’没有名为‘sh_offset’的成员
img2srec.c:369: 错误: ‘struct <anonymous>’没有名为‘sh_size’的成员
img2srec.c:370: 错误: ‘struct <anonymous>’没有名为‘sh_offset’的成员
img2srec.c:375: 警告: 内建函数 ‘fprintf’ 不兼容的隐式声明
img2srec.c:378: 错误: ‘loadOffset’未声明 (在此函数内第一次使用)
img2srec.c: 在函数‘main’中:
img2srec.c:399: 错误: ‘DWORD’未声明 (在此函数内第一次使用)
img2srec.c:399: 错误: expected ‘;’ before ‘offset’
img2srec.c:402: 错误: 提供给函数‘ConvertELF’的实参太多
img2srec.c:404: 警告: 隐式声明函数‘strcmp’
img2srec.c:405: 警告: 隐式声明函数‘ExtractNumber’
img2srec.c:405: 错误: ‘offset’未声明 (在此函数内第一次使用)
img2srec.c:406: 错误: 提供给函数‘ConvertELF’的实参太多
img2srec.c:409: 警告: 内建函数 ‘fprintf’ 不兼容的隐式声明
img2srec.c:409: 错误: ‘stderr’未声明 (在此函数内第一次使用)
make[1]: *** [img2srec.o] 错误 1
make[1]:正在离开目录 `/usr/local/arm/u-boot-1.2.0/tools'
make: *** [tools] 错误 2

作者: franke0000   发布时间: 2010-09-08

可以考虑换个2.95.3的arm-gcc

作者: T-Bagwell   发布时间: 2010-09-08

回复 T-Bagwell


    换过了,但是还是这个问题! 是不是我的编辑环境有问题阿?提示找不到那个 stdio.h之类的文件阿? 谢过!

作者: franke0000   发布时间: 2010-09-08



QUOTE:
回复  T-Bagwell


    换过了,但是还是这个问题! 是不是我的编辑环境有问题阿?提示找不到那个 stdi ...
franke0000 发表于 2010-09-08 10:42




    如果提示找不到这个,那可能是环境的问题了

你可以在u-boot目录下找找有没有这个文件

在Makefile的CFLAGS变量里加上-v看一下编译的时候搜索的include的路径

作者: T-Bagwell   发布时间: 2010-09-08