编译nios2-uclinux20121826常见的几个错误

本文详细解析了Linux内核编译过程中遇到的两个常见错误,并提供了相应的解决方案。错误一涉及文件路径和标准头文件不存在的问题,通过选择正确的lib配置解决了此问题。错误二则指向了scsi_cmnd.h文件中的未定义引用,通过修改相关代码行避免了引用错误。本文旨在帮助开发者解决内核编译过程中的常见问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


错误一: 

In file included from /home/fpga/uClinux-dist/lib/libc/include/stdio.h:9,                

   from cryptlib.c:59: 

 /home/fpga/uClinux-dist/lib/libc/include/stdarg.h:3:28: machine/stdarg.h: No such file or directory  In file included from cryptlib.c:59: 

 /home/fpga/uClinux-dist/lib/libc/include/stdio.h:125: error: parse error before "va_list" 

 /home/fpga/uClinux-dist/lib/libc/include/stdio.h:126: error: parse error before "va_list" 

 /home/fpga/uClinux-dist/lib/libc/include/stdio.h:127: error: parse error before "va_list"  

/home/fpga/uClinux-dist/lib/libc/include/stdio.h:129: error: parse error before "va_list" 

 /home/fpga/uClinux-dist/lib/libc/include/stdio.h:130: error: parse error before "va_list" 

 /home/fpga/uClinux-dist/lib/libc/include/stdio.h:131: error: parse error before "va_list" 

 /home/fpga/uClinux-dist/lib/libc/include/stdio.h:132: error: parse error before "va_list"  make[3]: *** [cryptlib.o] Error 1  make[3]: Leaving directory 

`/home/fpga/uClinux-dist/lib/libssl/crypto'  make[2]: *** [all] Error 1  make[2]: Leaving directory 

`/home/fpga/uClinux-dist/lib/libssl'  make[1]: *** [all] Error 2  make[1]: Leaving directory `

/home/fpga/uClinux-dist/lib'  make: *** [subdirs] Error 1


解决办法:
	这个主要是因为  make menuconfig 的时候lib必须选none  而不是默认的uclib;

错误二:
drivers/built-in.o(.text+0x28c00): In function `scsi_dma_map':
/home/hayder/nios2-linux/linux-2.6/include/scsi/scsi_cmnd.h:154: undefined
reference to `dma_map_sg'
drivers/built-in.o(.text+0x28c48): In function `scsi_dma_unmap':
/home/hayder/nios2-linux/linux-2.6/include/scsi/scsi_cmnd.h:154: undefined
reference to `dma_unmap_sg

解决办法:
	修改  /home/hayder/nios2-linux/linux-2.6/include/scsi/scsi_cmnd.h:154:
改为return 0;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值