C header files and compilation/linking

后端 未结 5 1085
迷失自我
迷失自我 2020-12-04 18:06

I know that header files have forward declarations of various functions, structs, etc. that are used in the .c file that \'calls\' the #include, ri

5条回答
  •  星月不相逢
    2020-12-04 18:42

    It's the linker that handles all that. The compiler just emits a special sequence in the object file saying "I have this external symbol func, please resolve it" for the linker. Then linker sees that, and searches all other object files and libraries for the symbol.

提交回复
热议问题