【发布时间】:2014-03-25 16:55:01
【问题描述】:
我将 Netbeans 用于我的 C++ 项目。我使用 make 编译了我的程序并遇到了这个错误:
collect2: error: ld terminated with signal 11 [Segmentation fault], core dumped
Makefile:4: recipe for target 'barn' failed
make: *** [barn] Error 1
然而,当我在 linux 环境(准确地说是 Ubuntu)中编译它时,它编译得很好。可能出了什么问题?
这是我输入 make -n 时得到的:
g++ -c main.cc
g++ -c Animal.cc
g++ -c Bird.cc
g++ -c Chicken.cc
g++ -c Cat.cc
g++ -c Pig.cc
g++ -o barn main.o Animal.o Bird.o Chicken.o Cat.o Pig.o Random.o
PS 我更喜欢使用 Netbeans
【问题讨论】:
-
尝试空运行并显示输出:make -n
-
@DavidKernin 编辑了它
-
哎呀。该段错误是否不止一次发生过?
-
@aschepler 是的,它还没有完全编译
-
建议尝试将“-Wl,--verbose”传递给 gcc 以调试链接器
标签: c++ linux netbeans compiler-errors linker-errors