C++ make最后一步中突然出现报错
A linker snapshot was created at:
/tmp/main_SL.out-2022-09-15-130330.ld-snapshot
ld: Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061.
collect2: error: ld returned 1 exit status
make[7]: *** [/Users/ushiushi/Study/JUMPS/code/bin/main_SL.out] Error 1
想知道引发报错的可能原因
中奖了,你这是把链接器搞崩溃了。你这是苹果系统吧,可以向苹果提交BUG Report
collect2: error: ld returned 1 exit status可能的原因:
1,检查函数名拼写是否都正确
2,程序本身需要include的头文件是否被遗漏了
3,.h种声明的函数,在.cpp文件中没有定义和实现
校验出错了。
Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061.
你看下macho_relocatable_file.cpp, 第2061行。
macho_relocatable_file.cpp文件第2061行,可以贴出来看看,可能是函数传参个数不对
服务器崩溃了,是系统的问题,可能是内存太大。