Question

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?

Was it helpful?

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

OTHER TIPS

Starting with libpng-1.6.0, you can configure libpng (when using the "configure" script) to prefix all exported symbols by means of the configuration option "--with-libpng-prefix=FOO_", where FOO_ can be any string beginning with a letter and containing only uppercase and lowercase letters, digits, and the underscore (i.e., a C language identifier). This creates a set of macros in pnglibconf.h, so this is transparent to applications; their function calls get transformed by the macros to use the modified names.

Essentially, it renames every exported symbol for you while building your own libpng.

I have not personally tested this feature.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top