[英]How to build a C library for iOS by Xcode 6?
I trying to build C library for iOS like the following picture. 我试图为iOS构建C库,如下图所示。
I have build the liblib.a
, but it compile error after I use liblib.a
我已经建立了
liblib.a
,但是在我使用liblib.a
之后它会编译错误。
The error log is like the following when I use liblib.a
当我使用
liblib.a
时,错误日志如下所示
file was built for archive which is not the architecture being linked (armv7): /Users/apk/Desktop/libTest/liblib.a
Undefined symbols for architecture armv7:
It seems the liblib.a
not support for armv7
, but I didn't find the armv7 and the arm64 in Build Setting -> Architectures. 似乎
liblib.a
不支持armv7
,但是在Build Setting-> Architectures中找不到armv7和arm64。
How do I build the library of C code
for armv7
and use in Objective-C
? 如何为
armv7
构建C code
库并在Objective-C
?
---------------------EDIT--------------------- - - - - - - - - - - -编辑 - - - - - - - - - - -
After I change the setting like the following picture. 更改设置后,如下图所示。
It has the .a file
. 它具有
.a file
。 But when I try to use this library , it also show 但是当我尝试使用该库时,它也会显示
file was built for archive which is not the architecture being linked (armv7): /Users/apk/Desktop/libTest/liblib.a
Undefined symbols for architecture armv7:
Did I missing something ? 我错过了什么吗?
---------------------EDIT2--------------------- --------------------- EDIT2 ---------------------
I build the .a by following step. 我按照以下步骤构建.a。
1.Create new project. 1.创建新项目。
2.Setting 2.设置
3. 3。
4. 4。
5.put the C file and the .h file into project. 5.将C文件和.h文件放入项目中。
Thanks in advance. 提前致谢。
基本SDK设置为“最新OS X”,而不是“最新iOS”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.