For example in Boost. I set an include directory in MSVC++2010 to the Boost root directory and have an #include in my source co
Most lib files have a Table Of Contents. The linker searches this table when it is looking for a symbol. If the symbol is not found it moves on to the next library, and so on, until all libraries have been searched.
Some linkers may decide to build a table of contents from all the libraries. This table would contain the symbol name and the library it is associated with. This speeds up the searches for symbols.
The search order depends on the manufacturer of the linker. There is no standard nor requirements for this. A linker may search by first come, first served as specified on the command line; last library specified or some other method. Check the documentation for the criteria.
Also search the web for name mangling. This is a technique that compilers use to resolve symbol naming conflicts.
Lastly, linkers may include all the functions in a library even if only one is used. Some linkers only include the code for the function. Depends on the manufacturer of the Linker. For example, does the linker include the entire I/O library when resolving puts or does it just include the necessary functions? Including the whole library speeds up build time but makes the executable huge. Including only necessary code slows the build process but shrinks the executable size.
In general, the Linking Phase is one of the faster parts of the translation process. If you are worried about build times, start the build at the end of the day or go for a walk after the build is started. ;-)