#include <stdio.h>
int main(){
printf("Hello!");
return 0;
}
错误:
[root@localhost Desktop]# gcc hello.c
collect2: ld terminated with signal 11 [Segmentation fault], core dumped
5 个解决方案
#1
http://*.com/questions/25371372/collect2-error-ld-terminated-with-signal-11-segmentation-fault-core-dumped
#2
那个网址里面好像也没说具体怎么解决啊!
#3
换gcc或者 ld
#4
连接过程出错一般都是.o文件,连接脚本或连接器的关系,这里.o文件应该没问题,所以可能是你安装的环境的关系了,建议换一个环境试试
#5
一般不是 gcc -o hello hello.c嘛
我有次是因为输入法的问题看上去也一样,但是出错了

#1
http://*.com/questions/25371372/collect2-error-ld-terminated-with-signal-11-segmentation-fault-core-dumped
#2
那个网址里面好像也没说具体怎么解决啊!
#3
换gcc或者 ld
#4
连接过程出错一般都是.o文件,连接脚本或连接器的关系,这里.o文件应该没问题,所以可能是你安装的环境的关系了,建议换一个环境试试
#5
一般不是 gcc -o hello hello.c嘛
我有次是因为输入法的问题看上去也一样,但是出错了
