I learned that a compiler translates a source file in a high-level language to an object file in machine language. I use Code blocks IDE, which is backed by MinGW compiler. But when I hit F9, Code blocks runs an executable file. Does this mean the "compiler" actually includes a linker with it?
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.
First, I should say that this is a massive topic and that I am not an expert on compilers, but I believe the answer to your question for the context you're answering it in is yes, the "compiler" is calling a linker; either that, or your IDE is doing it for you. I don't know Code Blocks, so I couldn't really say.
What I can say is that most of the toolkits I've worked with that are colloquially referred to as "compilers", like GCC (to which MinGW is closely related), do call a linker by default so as to reduce the user's workload in the simplest use case. Using GCC, you must explicitly tell it not to link by passing the option flag -c. This can be useful when building very large programs.
Despite this feature of GCC and others, you are correct that conceptually, a compiler and a linker are two separate things. However, it's important to note that there are many ways to get code to run on a computer, and in many cases the external distinction between these steps may be blurred or entirely nonexistent.