I’m making progress but without really understanding the big picture for now.
When you build a C project does it look for the header files first and then find a matching definition in a C file, then linking and compiling based on that?
I did an experiment where I changed the name of the .c file and it worked fine regardless of the name. So is it the header file name that matters the most?
I’m learning as I go so I apologize if I should have read this in a book or manual somewhere. If there is a helpful resource I would appreciate a link to it please. :)
@LouisIngenthron Thank you, that is really helpful. It makes sense but I didn’t realize the linker came at the end. That explains why it wasn’t generating a map file when I had a compilation error.
The header file thing is interesting to me too. So if I include a header and the function is defined elsewhere it while find the function definition and paste or link it into the file that calls that function?
Thank you for responding and taking the time to explain how this works. I was at the point where I didn’t even really know where to start looking.
@derickflorian "So if I include a header and the function is defined elsewhere it while find the function definition and paste or link it into the file that calls that function?"
Essentially, yes. "Paste" in the case of inline functions and "link" in every other case.