读书人

gcc编译 出现异常(.text+0x20): undef

发布时间: 2013-08-09 15:16:24 作者: rapoo

gcc编译 出现错误(.text+0x20): undefined reference to `main' collect2: ld 返回 1
编译的是很简单的hello world

#include <stdio.h>
int main(void)
{
printf("Hello, world!\n");
return 0;
}

用过各种编译
gcc -o test test.c
gcc -g -Wall test.c -o test
也不是很明白是什么意思
就是想至少能先输出hello wrold
新人不懂,求指点

[解决办法]


//把这个复制上次再运行一边看看 ,我运行是OK的
#include <stdio.h>
int main(void)
{
printf("Hello, world!\n");
return 0;
}

读书人网 >UNIXLINUX

热点推荐