Assuming I'm working in an IDE like Visual Studio to program in C or C++. Let's say I decide to statically link to an object file. Because I'm using Visual Studio, I configure the project properties linker settings (i.e. I don't edit a make file). What happens if I don't actually use any of the linked code in my program? What will the compiled code look like? Will it be bloated?
Will the IDE check for such cases to optimize the makefile? Or could the compiler check for this? Would it depend on the compiler?
Essentially this question was motivated by me not knowing what libraries I will need to use from SFML, thus I decided to link to all the libraries as a temporary action. Would linking to object files that aren't implemented bloat my binaries? Or would they be optimized away by the IDE, compiler, etc.?