0
votes

ld: warning: ignoring file
/Users/srm-mac10/Downloads/ICodeBlogStaticLibrarySample/MathTest/Classes/iCodeBlogsMathLibrary/libICodeMathUtils.a,
missing required architecture i386 in file Undefined symbols for architecture i386: "_OBJC_CLASS_$_MathFunctions", referenced from:
objc-class-ref in MathTestAppDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Following error coming while i am trying to make a static library in objective C. Any idea ?? Please help me.

2
Are u running this on simulator?V-Xtreme
Is this for OS X or iOS?Conrad Shultz
@VXtreme :Yes, I am running onn simulatoruser1073831
@Conrad Shultz : I am building for iOSuser1073831
I was facing same problem . I solved it by running it on device. Please check it on the device.V-Xtreme

2 Answers

2
votes

The iOS simulator runs natively on the system's CPU, which is an x86 architecture. Hence your code needs to be built for x86 (which is presumably working already) and any libraries you link to also need to be built for x86.

If this is a static library that someone else has supplied to you (perhaps you purchased it?) then you will need to request the x86 version as well and link against that.

If you are building the static library yourself, check the build settings for that project (I'm assuming it's a separate project) and make sure it's configured to be compilable for the simulator. Then explicitly build the library for the simulator.

(I've run into some weird issues with static libraries where Xcode 4.x fails to automatically build the correct library architecture, necessitating an explicit manual build.)

-1
votes

I think you have to set the flag "-all_load" in the "other linker flags" in your project build settings