lp / ObjCHiredis

Hiredis with Objective-C Interface
162 stars 22 forks source link

Use/Install ObjCHiredis #2

Closed Florian95 closed 12 years ago

Florian95 commented 12 years ago

Hello,

I import the libObjCHiredis_iOS.a into my framework (+ Add in Build Phases), and I add header in Header Search Path.

But I still have a "Use of undeclared identifier ObjCHiredis". Xcode dont find ObjCHiredis.h

Can you explain how to install ObjCHiredis ?

Regards,

dodikk commented 12 years ago

Have you tried including any of "-ObjC" or "-all_load" flag to "Other linker options" ?

Florian95 commented 12 years ago

OK, Xcode find ObjCHiredis.h.

But I have : ld: warning: ignoring file /..../libObjCHiredis_iOS.a, missing required architecture i386 in file /....../libObjCHiredis_iOS.a (2 slices) Undefined symbols for architecture i386: "_OBJCCLASS$_ObjCHiredis", referenced from: objc-class-ref in FriendsViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Florian95 commented 12 years ago

I only add libObjCHiredis_iOS.a to my project, and my two headers : hiredis.h & ObjCHiredis.h in User Header Search Path.

dodikk commented 12 years ago

First read some articles about iOS static libraries. For example,

https://github.com/farcaller/injective http://wiki.remobjects.com/wiki/Linking_Custom_Static_Libraries_from_your_Xcode_Projects

Florian95 commented 12 years ago

Hello,

I have read this 2 articles

I have downloaded : ObjCHiredis_iOS_1o3o9.zip

I follow all steps :

Now #import seems to work well.

I have an error when i write : ObjCHiredis *redis = [ObjCHiredis redis:@"127.0.0.1" on:[NSNumber numberWithInt:6379]];

I have : Undefined symbols for architecture i386: "_OBJCCLASS$_ObjCHiredis", referenced from: objc-class-ref in FriendsViewController.o ld: symbol(s) not found for architecture i386

Why its about architecture i386 in my iOS project ?

Thanks for your time.

dodikk commented 12 years ago

Maybe you need a separate *.a built for the simulator. Try cleaning your DerivedData folder and build again.

\ Sorry, I'm too busy at the moment to troubleshoot. Can you provide your project ( or at least screenshots of your settings )?

Florian95 commented 12 years ago

Thats it... The Simulator file .a..... Thank you !!!

Have a good day