1
votes

I am having trouble building an iPhone project for iOS Simulator. Building for the device actually works. The error is with the RestKit external library. Here is what I get:

ld: warning: ignoring file /Users/omar/Library/Developer/Xcode/DerivedData/Zolkin-geukgbaipukxjhacrofvkapbkmme/Build/Products/Debug-iphonesimulator/libRestKit.a, file was built for archive which is not the architecture being linked (i386): /Users/omar/Library/Developer/Xcode/DerivedData/Zolkin-geukgbaipukxjhacrofvkapbkmme/Build/Products/Debug-iphonesimulator/libRestKit.a
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_AFJSONRequestOperation", referenced from:
      objc-class-ref in GoogleMapsService.o
  "_OBJC_CLASS_$_RKAttributeMapping", referenced from:
      objc-class-ref in Distric.o
  "_OBJC_CLASS_$_RKObjectManager", referenced from:
      objc-class-ref in BaseService.o
  "_OBJC_CLASS_$_RKObjectMapping", referenced from:
      objc-class-ref in User.o
      objc-class-ref in City.o
      objc-class-ref in Distric.o
      objc-class-ref in ServerTimeInterval.o
      objc-class-ref in Address.o
      objc-class-ref in StoreDetails.o
      objc-class-ref in Store.o
      ...
  "_OBJC_CLASS_$_RKObjectRequestOperation", referenced from:
      objc-class-ref in BaseService.o
  "_OBJC_CLASS_$_RKRelationshipMapping", referenced from:
      objc-class-ref in Address.o
      objc-class-ref in StoreDetails.o
      objc-class-ref in Store.o
      objc-class-ref in Consumer.o
      objc-class-ref in PaginatedStoreListResponse.o
      objc-class-ref in ExtractResponse.o
      objc-class-ref in CategoryData.o
      ...
  "_OBJC_CLASS_$_RKResponseDescriptor", referenced from:
      objc-class-ref in BaseService.o
  "_RKlcl_configure_by_name", referenced from:
      -[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any help would be greatly appreciated...

Thanks Omar

1
How did you add RestKit to the project? - Wain

1 Answers

0
votes

This often means the .m file is not listed under Compile Sources in Build Phases of your target. Sometimes Xcode makes you add the .m file manually.

try this

TargetSettings -> Build Phases -> Compile Sources -> add your .m class ->Build and Run

The other thing to look out for are name conflicts. Make sure all your classes are uniquely named or you might get a similarly cryptic clang error

If none of that works check out this thread. It's possible, if you're running in a simulator, that it is trying to use the wrong processor architecture.

file was built for archive which is not the architecture being linked (i386)