longbowk
longbowk

Reputation: 229

Multiple copies of same static libraries?

I have one static library named libplatform.a, and two static libraries liba.a and libb.a are built upon libplatform.a. Now I want to create a program named foo, which will be built together with all the three static libraries.

So how many copies of libplatform.a will be kept in the final program foo?

Upvotes: 1

Views: 367

Answers (1)

Employed Russian
Employed Russian

Reputation: 213506

So how many copies of libplatform.a will be kept in the final program foo?

Not more than one, likely less than one. Only one copy of some files in libplatform.a will be included in the final executable. Here is an explanation of how the linker works.

Upvotes: 1

Related Questions