首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

gcc编译 出现异常(.text+0x20): undefined reference to `main' collect2: ld 返回 1

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

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;
}

热点排行