您的位置:首页 > 其它

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

2011-12-03 20:15 344 查看
这几天用源代码方式安装程序是老是出现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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: