A compiler transforms the source code of a computer program into an executable binary. As libraries are needed, and that is normally the case, those are linked with the binary into the executable binary.
This is clear: only after compilation (and if necessary linking) a program can be executed.
Annotation: akin to the compiler is the interpreter. The interpreter does not transform the program source code, instead it executes it line by line.