errno.h中定义的常量undeclared (first use in this function)

这几天用源代码方式安装程序是老是出现undeclared (first use in this function)的错误,例如下面的这个

编译源文件错误error.h

Created Saturday 03 December 2011
SOURCE=1 -o objects/fileio.o fileio.c
fileio.c: In function ‘readfile’:
fileio.c:1560:40: error: ‘EINVAL’ undeclared (first use in this function)
fileio.c:1560:40: note: each undeclared identifier is reported only once for each function it appears in
fileio.c: In function ‘buf_write_bytes’:
fileio.c:5681:36: error: ‘EINVAL’ undeclared (first use in this function)
make[1]: *** [objects/fileio.o] Error 1
make[1]: Leaving directory `/home/hyf/Downloads/vim7/src'
make: *** [first] Error 2

后来发现是编译源码的时候要用到这个文件但是里面却是什么也没有,可能是之前在编译x86的时候删了记得之前是#include <asm/errno.h>
/usr/include/linux/errno.h
之前是
#ifndef _LINUX_ERRNO_H
#define _LINUX_ERRNO_H

#include <errno.h>


#endif

但是我的目录结构里面没有asm只有asm-generic,现在是:
#ifndef _LINUX_ERRNO_H
#define _LINUX_ERRNO_H

#include <asm-generic/errno.h>

#endif

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值