QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1338|回复: 1

请教gcc下stat()函数的编译问题 急!!!

[复制链接]
发表于 2005-4-10 02:40:33 | 显示全部楼层 |阅读模式
我在程序中添加了stat()函数后总是错误,最后写了一个测试程序如下:
#include<stdio.h>
#include<stdlib.h>
#include<sys/stat.h>
#include<unistd.h>
mian()
{
struct stat buf;
stat("sort.c",&buf);
printf("sort.c file size = %d \n",buf.st_size);
}


但是编译时总是出现下列提示:

/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o:Infunction '_start':
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o(.test+0x1: undefined reference to 'main'
collect2: ld returnned 1 exit status

请问这是什么原因。谢谢!!
发表于 2005-4-11 10:54:28 | 显示全部楼层
是main不是mian(面?)
你饿疯了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-29 07:17 , Processed in 0.036107 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表