I've always been confused about how the linker works, and it's a difficult subject to search for.
To demonstrate my question and to provide a framework for an answer, I'll put down what I know (or think I know) so far. I may be very wrong. :)
First, each .cpp file is built into an intermediate file (.o for Posix/ELF and .obj for Win/PE I believe). This intermediate file contains all the symbols defined by the .cpp it was built from and has instructions for what external links it needs to be properly resolved. As an extension to this, Posix systems let you combine the .o files into a .a file (Which doesn't seem to do anything more than combine? What command does this?). Is .lib the Win/PE equivalent of the Posix .a file?
Next, the intermediate files are linked together, external dependencies resolved, and you have your executable. Am I missing any steps?
Thanks!