gcc compiling problem
hello
here is my code
#include <sys/ipc.h>
#include <sys/msg.h>
#include <unistd.h>
#include <stdio.h>
int man(int argc, char **argv)
{
int c,oflag,mqid;
oflag=0600 | IPC_CREAT;
while ((c = getopt(argc,argv,"e")) != -1)
{
switch (c)
{
case 'e':
oflag |= IPC_EXCL;
break;
}
}
if (optind != argc - 1)
printf("usage: test [-e] <pathname>\n");
mqid=msgget(ftok(argv[optind],0),oflag);
return 0;
}
and when I compile , ld return error
gcc -o test test.c
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o: In function `_start':
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
|