undefined reference to `main'
写了一个很小的程序:
----------------------
#include <stdio.h>
main ()
{
printf ( "HELLO WORLD!\n ");
}
----------------------
用 %gcc -o test test.c 编译
没有问题,程序执行的结果也正确。
但使用 -d 选项编译时,gcc 报错
% gcc -d -o test tset.c
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/http://www.cnblogs.com/../crt1.o(.text+0x18): In function `_start ':
: undefined reference to `main '
collect2: ld returned 1 exit status
请各位大虾帮忙诊断一下这个问题如何解决?
这是源文件改动后没有保存所致!!