如何建立一个C库通过X code 6的iOS? [英] How to build a C library for iOS by Xcode 6?
问题描述
我试图建立C库,查找类似下面的图片的iOS。
我建 liblib.a
,我却用它后,编译错误 liblib.a
错误日志就像当我用下面的 liblib.a
文件是专为存档而不是被连接的架构(ARMv7的):/Users/apk/Desktop/libTest/liblib.a
适用于建筑的ARMv7未定义的符号:
看来 liblib.a
为不支持的ARMv7
,但我没有找到的ARMv7和arm64在构建设置 - >架构
如何建立 C code的库
为的ARMv7
和<$ C $使用C>的Objective-C ?
---------------------编辑---------------------
在更改类似下面的图片设置。
它的某文件
。但是,当我尝试使用这个库,它也显示
文件是专为存档而不是被连接的架构(ARMv7的):/Users/apk/Desktop/libTest/liblib.a
适用于建筑的ARMv7未定义的符号:
难道我失去了一些东西?
--------------------- EDIT2 ---------------------
我通过以下步骤构建.A。
1,创建新的项目。
2.设置
3
4
5.put在 C文件和 .h文件中到项目中。
<醇开始=6>先谢谢了。
你想要创建库的ios见下图的架构设置
试试这个
I trying to build C library for iOS like the following picture.
I have build the liblib.a
, but it compile error after I use liblib.a
The error log is like the following when I use 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.
How do I build the library of C code
for armv7
and use in Objective-C
?
---------------------EDIT---------------------
After I change the setting like the following picture.
It has the .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---------------------
I build the .a by following step.
1.Create new project.
2.Setting
3.
4.
5.put the C file and the .h file into project.
- Press the build button
Thanks in advance.
You Want Creating library for ios see below picture for Architectures setting
Try this
这篇关于如何建立一个C库通过X code 6的iOS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!