Roxanne Roxanne - 11 days ago 9
C Question

Error collect2 : ld returned exit status

When I try to compile my file, I have this error:

/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


I searched on several forums without success.

The problem is my function?

Answer

You might be missing one of the following:

  1. Compilation of the file that contains the function definition, or
  2. Missing to the link the file that contains compilation output (from the above step).

For a quick overview of compilation and linking process, see this https://www3.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html#zz-1.4