#include <stdio.h>
int main()
{
printf("test1");
return 1;
}
#include <stdio.h>
int main()
{
printf("test2");
return 1;
}
#include <stdio.h>
int main()
{
printf("test3");
return 1;
}
我这样编译他们,提示为:
[root@localhost linuxss]# gcc -Wall -o program test1.c test2.c test3.c
test1.c:6:2: warning: no newline at end of file
test2.c:6:2: warning: no newline at end of file
test3.c:6:2: warning: no newline at end of file
/tmp/ccGxh8RG.o(.text+0x0): In function `main':
: multiple definition of `main'
/tmp/cckfv0cq.o(.text+0x0): first defined here
/tmp/ccu0FSg4.o(.text+0x0): In function `main':
: multiple definition of `main'
/tmp/cckfv0cq.o(.text+0x0): first defined here
collect2: ld returned 1 exit status