Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 958
U_D Avatar asked Mar 27 '13 13:03

U_D


2 Answers

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.

like image 51
Dmitry Zhukov Avatar answered Oct 19 '22 00:10

Dmitry Zhukov


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.

like image 7
Lucas Goossen Avatar answered Oct 19 '22 00:10

Lucas Goossen