U_D
U_D

Reputation: 741

ignoring file [path] missing required architecture i386 in file

I'm quite new to Xcode and Iphone development and ran into the following problem:

I opened a new project and added *.h and a *.a files (which I recived from a certain device vendor). I get the following warning:

ld: warning: ignoring file /Users/udi/Desktop/Xcode/Xcode Projects/Scosche/libmyTrekSDK_armv7.a, missing required architecture i386 in file /Users/udi/Desktop/Xcode/Xcode Projects/Scosche/libmyTrekSDK_armv7.a (2 slices)

If I ignore the warning, and try to instanciate the class that is given to me in the header file, I get these errors:

ld: warning: ignoring file [Path/FileName.a], missing required architecture i386 in file [Path/FileName.a] (2 slices)

Undefined symbols for architecture i386:

"_OBJC_CLASS_$_HRMonitor", referenced from:

objc-class-ref in ViewController.o

ld: symbol(s) not found for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've checked the Framework Search Pathes (as mantioned in many other posts) and it clear.

More info:

  1. I'm Using Xcode 4.6.1
  2. The files are currently located at project's root folder.
  3. I'm using a Single View Application tamplate.

Appreciate any help

Upvotes: 28

Views: 24713

Answers (3)

Yunus Nedim Mehel
Yunus Nedim Mehel

Reputation: 12389

If you are working with a 3rd party code, keep in mind that some SDKs may not work on the simulator. The same build error I have encountered vanished, when I ran the project on the device.

Upvotes: 4

Lucas Goossen
Lucas Goossen

Reputation: 517

Change your target's "Build Settings > Build Active Architectures Only" to "No"

This is doing the same thing as Dmitry Zhukov's answer but doing it thru Xcode instead of going around its back.

Upvotes: 8

Dmitry Zhukov
Dmitry Zhukov

Reputation: 1816

This warning means that you're trying to use library made for Device (ARM) with your Simulator (i386).

You can use this terminal command to create a universal library:

lipo -create lib_arm.a lib_i386.a -output lib_universal.a

More info about lipo command here.

Upvotes: 52

Related Questions