Static library & Dynamic library : Confusion

前端 未结 3 2116
栀梦
栀梦 2020-12-29 15:36

I need little clarification in this area. I feel that the terms Static library & Dynamic Library are not correct.

  • lib1.o + lib2.o
3条回答
  •  臣服心动
    2020-12-29 16:12

    .o files are not any kind of library file. They are an object file.

    .a/.lib files are linked at build time. They cannot be replaced after the fact. This makes them static.

    .so/.dll files are linked at runtime. They can be replaced any time before execution starts. This makes them dynamic.

    Relocation refers to placement of a binary in memory; code from static libraries is integrated with the binary and so can't be relocated independently.

提交回复
热议问题