I am writing an iOS framework Foo
that depends on a static third-party library Lib
and have problems getting the linking right.
If Foo
was a static library, I would not link it against Lib
, and only link the master project against both of them. But this approach does not seem to work with a framework: the linker complains about missing symbols from Lib
.
So I took the other approach and linked Foo
against Lib
. Now the linker is happy, but there’s an obvious catch: if the master project uses Lib
for its own reasons and links both against Foo
and Lib
, I get duplicate symbols:
Class <Something> is implemented in both <Here> and <There>.
One of the two will be used. Which one is undefined.
I know I can stop linking the app against Lib
and all will be fine, but I’d like to get things right. How?