iosstatic-librariescocoapodslibpnglibharu

Avoid duplicate symbols with static library and cocoapods


I'm using OpenCV through cocoapods and libharu, both are using libpng, I wasn't able to include the opencv.framework on libharu static library to use libpng.

Do I need rename every symbol or there is a way to use the same libpng?


Solution

  • Third party static libraries should never link other third party static libraries themselves. All libraries should be linked together at the end by the final application link step. If the cocoapod spec is calling for one static library to include another, then it is incorrect and needs to be fixed.

    For more on this, see this question, as well as the questions it links:

    ObjC: How to compile static library that includes optional classes that depend on a third party library