问题描述
我是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:
如果我忽略了警告,并试图在头文件中给我提供的类,我会得到这些错误:
If I ignore the warning, and try to instanciate the class that is given to me in the header file, I get these errors:
架构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.
更多信息:
- 我使用Xcode 4.6.1
-
- 这些文件目前位于项目的根文件夹。
- 我正在使用单视图应用程序模板。
欣赏任何帮助
推荐答案
此警告表示您正在尝试使用您的模拟器(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在文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!