Guowang
Guowang

Reputation: 1

How to hide headers when packaging static library?

I want to put my private headers into my static library, so the customers can only see the public headers and .a file, but setting the headers "private" when packaging the library didn't work. Adding only the public headers and source files(.a) to the customer's project would cause errors:the “private” headers not found...Any help please?

Upvotes: 0

Views: 125

Answers (1)

MattP
MattP

Reputation: 2075

Without anything concrete to go on, I can describe what I have run into in the past. Your .h files are possibly using #import with references to your private headers. You will need to move those to your .m files. If this causes issues in your .h files due to undeclared classes, etc., you will have to do forward declarations with @class or other similar techniques.

Upvotes: 1

Related Questions