How can I share code across static libraries without duplicate symbol errors?

Posted by Ben Flynn on Stack Overflow See other posts from Stack Overflow or by Ben Flynn
Published on 2012-07-10T03:12:06Z Indexed on 2012/07/10 3:15 UTC
Read the original article Hit count: 217

Filed under:
|
|
|

I am new to building static libraries and would like to create 2(+) libraries each of which has some unique code and some shared code. My intention is that other projects will link one or more of these static libraries.

Util.h/m  <-- Shared
ImplOne.h/m  <-- Unique to 'ImplOne'
ImplTwo.h/m  <-- Unique to 'ImplTwo'

I am using XCode and generating the libraries by building Util.m and ImplOne.m in one case, and Util.m and ImplTwo.m in the other.

Of course the issue is that I now cannot use these libraries together because they will have duplicate symbols. What is a better architecture for this situation?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about xcode