Do I need static libraries to statically link?

后端 未结 4 1431
旧时难觅i
旧时难觅i 2020-12-16 02:19

On \'C\', Linux,

Do I need static libraries to statically link, or the shared ones I have suffice? If not, why not? (Don\'t they contain the same data?)

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-16 03:17

    All libraries you link into a statically linked program must be the static variant. While the dynamic (libfoo.so) and static (libfoo.a) libraries have the same functions in them, they are different format files and so you need the matching type for your program.

提交回复
热议问题