Process for linking static ObjC libraries in XCode

Posted by madmik3 on Stack Overflow See other posts from Stack Overflow or by madmik3
Published on 2010-05-10T16:37:17Z Indexed on 2010/05/10 17:34 UTC
Read the original article Hit count: 278

Filed under:
|
|
|

I'm trying to link to a static library and I keep getting linker errors. I've found a few sites that post examples but I have not been able to see what I am doing wrong.

First I create a project that will link to my lib

add> existing files
find my .xcodeproj file
select "Copy items into destination groups folder"...
Select my host project as Add To Targets.

Then I add a direct dependency to my host app
expand targets
double click MyHost.app
click + under direct dependencies
select my lib

Then I set build flags

double click MyHost application icon in Groups and Files.

click the build tab

then I set the OtherLinerFlag to -ObjC
then I set Header Search Paths to my header file location for my static library.

I pass the compile stage but any classes in my static lib cause linker error:
literal-pointer@_OBJC@_cls_refs@SomeClass in MyHost.o

thanks!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about xcode