忽略file [path]缺少需要的架构i386在文件中 [英] ignoring file [path] missing required architecture i386 in file

查看:190
本文介绍了忽略file [path]缺少需要的架构i386在文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Xcode和Iphone开发的新手,遇到了以下问题:

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

我打开一个新项目,添加了* .h和* .a文件(我从某个设备供应商那里获取)。
我收到以下警告:

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:忽略文件/ Users / udi / Desktop / Xcode / Xcode Projects / Scosche / libmyTrekSDK_armv7.a,缺少文件/用户/ udi / Desktop / Xcode / Xcode项目/ Scosche / libmyTrekSDK_armv7.a(2切片)中需要的架构i386

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:忽略文件[Path / FileName.a],缺少必需的体系结构文件中的i386 [Path / FileName.a](2个切片)

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

架构i386的未定义符号

Undefined symbols for architecture i386:

_ OBJC_CLASS _ $ _ HRMonitor,引用自:

"_OBJC_CLASS_$_HRMonitor", referenced from:

objc- ref in ViewController.o

objc-class-ref in ViewController.o

ld:没有为架构i386找到符号

ld: symbol(s) not found for architecture i386

clang:error:链接器命令失败,退出代码1(使用-v查看
调用)

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.

更多信息:


  1. 我使用Xcode 4.6.1

  2. 这些文件目前位于项目的根文件夹。

  3. 我正在使用单视图应用程序模板。

欣赏任何帮助

推荐答案

此警告表示您正在尝试使用您的模拟器(i386)为设备(ARM)库。

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

有关 lipo 命令此处

这篇关于忽略file [path]缺少需要的架构i386在文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆