Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Export header of static library for iOS

Hi, I'm pretty new to iOS programming, and I'm stuck with this question for days, hopefully some one can help me out.

So, basically, I want to create a static library for iOS using existing C++ code. so I followed the instructions here https://developer.apple.com/library/ios/technotes/iOSStaticLibraries/Articles/cr eating.html#//apple_ref/doc/uid/TP40012554-CH2-SW1

Because we don't want our source code seen by the ones who use our library, I wrote a header to encapsulate existing codes. It looks like this:


#import <Foundation/Foundation.h>

#import "OnCharRec.h"


@interface HWLib_s : NSObject

{

@private

COnCharRec * prec; // this class is int the header OnCharRec.h which we don't want to export to the others.

}

- (int)newRecognizer:(char *)filePath:(int)length;

- (void)addPoint:(short)x:(short)y;

- (void)deleteRecognizer;

- (void)strokeFinished;

- (char*)getCandidates;

- (float*)getDists;

- (void)reset;

- (void)recognize:(int)strokeFrom:(int)strokeTo;

- (void)setType:(unsigned char)mType;

@end


I added it to the copy file build phase, and the products look like this

User uploaded file

I sent is to our users. But when they uses my library, the get the error of can't find the header OnCharRec.h

So my question is that how can I build a library that only expose the header I wrote (HWLib_s ) that can be used by the others?(Without exporting the other headers like OnCharRec.h)

Posted on Apr 20, 2015 12:55 AM

Reply
1 reply

Export header of static library for iOS

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.