GCC编译出错driver_test.c:(.text+0x16a): undefined reference to `clode'

qq_39129441 2017-06-11 05:50:15
编译的时候undefined reference to `clode',不知道哪错了
#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
#include<linux/fcntl.h>

int main(int argc,char*argv)
{
int fd,cnt;
char buf[256];
printf("vmalloc testing\n");
fd=open("/dev/myalloc",O_RDWR);
if(fd==0)
{
printf("File cannot open\n");
return 1;
}
cnt=read(fd,buf,256);
buf[255]='\0';
if(cnt>0)
printf("Read:%s\n",buf);
else
printf("Read:>>error<<\n");

printf("Write:");
scanf("%s",buf);
cnt=write(fd,buf,256);
if(cnt==0)
printf("Write error\n");
cnt=read(fd,buf,256);
if(cnt>0)
printf("Read:%s\n",buf);
else
printf("Read:>>error<<\n");
clode(fd);
return 0;
}
...全文
427 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_39129441 2017-06-13
  • 打赏
  • 举报
回复
还真是,粗心了。
jklinux 2017-06-13
  • 打赏
  • 举报
回复
clode改成close

1,318

社区成员

发帖
与我相关
我的任务
社区描述
主要是开发驱动技术
社区管理员
  • 驱动程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧