How to resolve class name conflicts when creating iOS frameworks?

I am writing an iOS infrastructure Foothat depends on a third-party static library Liband problems with proper binding.

If I Foowas a static library, I would not associate it with Liband only associate the main project with both of them. But this approach does not seem to work with the wireframe: the linker complains about the lack of characters from Lib.

So, I took a different approach and linked Foowith Lib. Now the linker is happy, but theres an obvious catch: if the master project uses Libfor its own reasons and refers to both Fooand to Lib, I get duplicate characters:

Class <Something> is implemented in both <Here> and <There>.
One of the two will be used. Which one is undefined.

I know that I can stop associating the application with Liband everything will be fine, but I'd like to do everything right. How?

+4
source share
1 answer

I managed to get this to work for the framework, although the documents say that it should work for the static library as well.

I made a link to the main project both with Fooand Libas you say. Now Foohas errors of "missing character". Select a target Fooand navigate to other linker flags. Add -weak_framework Liband presto! the linker will stop complaining. Character duplication errors are repeated.

According to docs :

-weak_framework . , -weak_library linker

+1

Source: https://habr.com/ru/post/1544923/


All Articles