当前位置:编程学习 > C/C++ >>

编译错误:errno undeclared的解决

eclipsefunctionlinux
今天用eclipse编译arm linux驱动时,一直报错
'errno' undeclared (first use in this function)
在网上查了N久,才发现头文件包含错了,
以前是#include<asm/errno.h>
改为:#include<errno.h>
即可。

------------------------------------------

errno.h中定义的常量undeclared (first use in this function)
分类: Linux学习 2011-12-03 20:15 1319人阅读 评论(0) 收藏 举报
functionlinuxeachx86
这几天用源代码方式安装程序是老是出现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

答案:<%
rem 检查sql字符串中是否有单引号,有则进行转化
function CheckStr(str)
dim tstr,l,i,ch
l=len(str)
for i=1 to l
ch=mid(str,i,1)
if ch="'" then
tstr=tstr+"'"
end if
tstr=tstr+ch
next
CheckStr=tstr
end function
%>

以上资料由动网先锋(http://www.aspsky.net)整理制作,转载请说明出处!

上一个:简单的检查输入email是否合法程序
下一个:WIN2K下COM组件的反注册方法

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,