You obviously have to include relevant .h files for the compiler to do syntax checking, etc, but how does does the linker know which library to pull the symbol from? For instance, if I make a call to strcpy how would the linker actually traverse the library folder to find this? Or would it just go directly to libc?
My latest program is using a decent amount of encryption functions so I am using openssl to do so; when making calls to these functions I was receiving an error that the functions didn't exist until I gave a -lssl flag on gcc to include libssl. I am assuming that by default the linker will only use functions from libc and all user created libraries must be explicitly stated, even if in the same directory? Or am I missing something?