How to build a C library for iOS by Xcode 6?

风流意气都作罢 提交于 2019-11-28 09:47:39

问题


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.

  1. Press the build button

Thanks in advance.


回答1:


You Want Creating library for ios see below picture for Architectures setting

Try this




回答2:


The Base SDK is set to "Latest OS X" not "Latest iOS".



来源:https://stackoverflow.com/questions/26778087/how-to-build-a-c-library-for-ios-by-xcode-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!