0

I am doing a C++ project for one of my classes that involves using multiple ".cpp" files as well as a ".h" file. The files are "bio.cpp" (the one that we are meant to create/edit), "main.cpp", and "bio.h". Both "main.cpp" and "bio.h" are given to us.

Before I wrote any of my own code, I created the files in XCode and compiled them only to be given this error that says

ld: symbol(s) not found for architecture x86_64

enter image description here

It seems to be saying that there are missing symbols for the functions in "main.cpp" because they were written in "bio.h". I'm very confused as how to fix this issue.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • At SatckOverflow you need to post text as text not a picture of text. Also include a [mcve] – drescherjm Mar 10 '20 at 02:36
  • ***because they were written in "bio.h"*** They should not be implemented in the header unless these are templates. – drescherjm Mar 10 '20 at 02:38
  • Maybe `bio.cpp` is not being compiled as part of the project. – drescherjm Mar 10 '20 at 02:39
  • You built an incomplete project (no `bio.cpp`) and the linker produced an error saying that the project is incomplete. Is that surprising? Start your project ASAP to fix the issue. – JaMiT Mar 10 '20 at 02:53
  • 1
    Does this answer your question? [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – JaMiT Mar 10 '20 at 02:54
  • These are presumably the methods you are expected to write yourself. The code you have been provided probably has declarations in the header and is called from main, but there's no implementation. So the compiler tries to build the incomplete project - it's just telling you what's missing. – gavinb Mar 13 '20 at 11:09

0 Answers0