How do static libraries do linking to dependencies?

后端 未结 3 1166
深忆病人
深忆病人 2020-12-28 15:41

Say I have libA. It depends on, for example, libSomething for the simple fact that a non-inline method of libA makes a call to a method in libSomething.h. How does the depen

3条回答
  •  隐瞒了意图╮
    2020-12-28 16:30

    Static linking is just copying the whole items (functions, constants, etc) into the resulting executable. If a static library's code contains references to some shared library items, these references will become dependencies in the resulting executable. The same holds if you link a library instead of executable.

    This thread discusses how it happens in Linux.

提交回复
热议问题