C++: Compiler and Linker functionality

后端 未结 8 473
野趣味
野趣味 2020-12-10 08:39

I want to understand exactly which part of a program compiler looks at and which the linker looks at. So I wrote the following code:

#include          


        
8条回答
  •  自闭症患者
    2020-12-10 08:54

    Say you want to eat some soup, so you go to a restaurant.

    You search the menu for soup. If you don't find it in the menu, you leave the restaurant. (kind of like a compiler complaining it couldn't find the function) If you find it, what do you do?

    You call the waiter to go get you some soup. However, just because it's in the menu, doesn't mean that they also have it in the kitchen. Could be an outdated menu, it could be that someone forgot to tell the chef that he's supposed to make soup. So again, you leave. (like an error from the linker that it couldn't find the symbol)

提交回复
热议问题