xcode 构建静态库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5732762/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Build static library
提问by TheFrancisOne
I am trying to build a .astatic library for my iPhone project.
我正在尝试为我的 iPhone 项目构建一个.a静态库。
So, I have created a new project, and I used the template Cocoa Touch Static Library
.
所以,我创建了一个新项目,并使用了模板Cocoa Touch Static Library
。
Then, in XCode 4.0
, I add my .mand .hfiles.
然后,在 中XCode 4.0
,我添加了我的.m和.h文件。
i have successfully build the project, but no .afile is created In XCode
, I see .afile in Products
category but displayed in red; so it doesn't exist.
我已成功构建项目,但未创建.a文件 在 中XCode
,我在类别中看到.a文件Products
但显示为红色;所以它不存在。
I don't understand why my build button don't create .afile, any help?
我不明白为什么我的构建按钮不创建.a文件,有什么帮助吗?
回答by Blake Watters
I see that you accepted the answer, but I thought I'd leave a note for future library developers. After upgrading an Xcode 3.x based static library project to 4.x, the library will not always upgrade and begin doing universal library builds. When this happens, the project build will be successful and apps linked against the target dependency will run fine, but you'll get red static library files showing in the projects you pull in. This is very annoying and the only fix I have found is to recreate the project files -- I tried auditing the build settings but was unable to figure out the confounding factors.
我看到你接受了答案,但我想我会为未来的图书馆开发人员留下一张便条。将基于 Xcode 3.x 的静态库项目升级到 4.x 后,该库不会总是升级并开始构建通用库。发生这种情况时,项目构建将成功并且针对目标依赖项链接的应用程序将正常运行,但是您会在您拉入的项目中看到红色静态库文件。这非常烦人,我发现的唯一解决方法是重新创建项目文件——我尝试审核构建设置,但无法找出混杂因素。
Hope this helps save somebody the 2 hours I just lost :-P
希望这有助于节省我刚刚失去的 2 个小时:-P