简体   繁体   English

Xcode 4静态库创建混乱

[英]Xcode 4 Static library creation Confusion

I want to create static library through Xcode 4.I took one .a build using cocoa Touch static library.When I add .h file and .a file into new project ,it gives missing required architecture i386 in file error.I have to set any Header search path in xcode 4 like earlier versions.? 我想通过Xcode 4创建静态库。我使用可可Touch静态库进行了一个.a构建。当我将.h文件和.a文件添加到新项目中时,它在文件错误中给出了缺少所需的体系结构i386。我必须设置xcode 4中的任何标头搜索路径(如早期版本)。

1)what is the best approach, can i develop static library which will work in simulator and device as well through xcode 4? 1)什么是最好的方法,我是否可以开发静态库,该库也可以通过xcode 4在模拟器和设备中使用?

2)some tutorials are saying that we have to develop a)Create a build for the device (the armv6 and armv7 architecture). 2)一些教程说我们必须开发a)创建设备的构建(armv6和armv7体系结构)。 b)Create a build for the simulator (the i386 architecture). b)为模拟器创建一个构建(i386体系结构)。 cant we develop single .a component for all architecture? 我们不能为所有架构开发单个.a组件吗?

which one is the right in above?what is the right approach?any help please? 以上哪一项是正确的?什么是正确的方法?有什么帮助吗?

A nice way to solve this is to use the workspace feature and include the library's target in the main project. 解决此问题的一种好方法是使用工作区功能,并将库的目标包含在主项目中。 That way the library gets compiled more or less automatically with the correct settings and it's much easier to propagate changes in the library code. 这样,使用正确的设置可以自动或多或少地自动编译库,并且更容易在库代码中传播更改。 Of course, this is only an option unless you want to distribute the library without sources to other people. 当然,这只是一个选择,除非您希望将没有资源的库分发给其他人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM