Don't expose symbols from a used library in own static library

Viewed 8949

I am writing a reusable static library for the iPhone, following the directions provided here.

I want to use minizip in my library internally, but don't want to expose it to the user.

It should be possible for the user to include minizip themselves, possibly a different version, and not cause clashes with my "inner" minizip version.

Is this possible?

Edit:

I've tried adding -fvisibility=hidden to additional compiler flags for minizip files and changing functions to be __private_extern__ and __attribute__((visibility("hidden"))), but it still seems to produce defined external symbols:

00000918 T _unzOpen
0000058e T _unzOpen2
00001d06 T _unzOpenCurrentFile
00001d6b T _unzOpenCurrentFile2
...

Edit #2:

Apparently the symbols marked with these annotations are only made private by the linker, which never happens when Xcode builds the sources, since it adds the -c parameter ("Compile or assemble the source files, but do not link.")

2 Answers
Related