0

enter image description hereenter image description here

Undefined symbols for architecture arm64:
  "add(int, int)", referenced from:
      _main in example1-612cc2.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I checked to see if clang was up to date. I believe its line 9 since I'm not too familiar with functions. I'm just learning and I have never seen that error before.

fabian
  • 80,457
  • 12
  • 86
  • 114
Nafi
  • 1
  • 1
  • 2
    `add` is declared (you told the compiler that a function with the given signature exists), but it's not defined anywhere, (you didn't provide any code for this function) – Lukas-T May 15 '23 at 10:00
  • You still have to write code for your add function (provide a definition), you only have a declaration now (told the compiler what the function will look like). Either you should still compile another file with the source code for that function, or write the code for that function in an existing source file. Some notes : It is more common to put the declaration in a header file, next time put the source code in your question directly (not through images) – Pepijn Kramer May 15 '23 at 10:05

0 Answers0