When linking statically, does the linker include the whole library?

后端 未结 4 524
失恋的感觉
失恋的感觉 2020-12-16 14:48

For example, if I static link to freeglut, does the compiler include everything from freeglut or only the parts that I use? Of course, this implies that the linker (or compi

4条回答
  •  清酒与你
    2020-12-16 15:27

    I think you can write a sample lib to get the answer. In a C++ lib, 1 write a class to print all the subclass name. 2 and several class derived from it.

    In a real main program, just use one of the sub-classes.

    And then print all the name.

    Then you will find the answer, I think.

提交回复
热议问题