当我尝试编译我的文件时,出现此错误:
/tmp/ccN3Rs5C.o : Dans la fonction « BellmanFord » :
bellman.c:(.text+0x27c) : référence indéfinie vers « min »
collect2: error: ld returned 1 exit status
我在几个论坛上搜索都没有成功。
问题出在我的函数上?
最佳答案
您可能缺少以下其中一项:
- 包含函数定义的文件的编译,或
- 链接缺少包含编译输出的文件(来自 上述步骤)。
有关编译和链接过程的快速概述,请参阅此 https://www3.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html#zz-1.4
关于c - 错误收集2 : ld returned exit status,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40832644/