如何修复“是动态库,而不是添加到静态库”警告?

编程入门 行业动态 更新时间:2024-10-28 11:22:07
本文介绍了如何修复“是动态库,而不是添加到静态库”警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我刚刚升级到Xcode 5.1,突然有一个新的警告:

I just upgraded to Xcode 5.1, and all of a sudden there is a new warning:

/Applications/Xcode.app/内容/开发人员/工具链/ XcodeDefault.xctoolchain / usr / bin / libtool:文件: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1 .sdk / usr / lib / libz.dylib 是一个动态库,未添加到静态库中

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/lib/libz.dylib is a dynamic library, not added to the static library

目标它生成这个警告是cocos2d-iphone v2静态库(而不是使用cocos2d模板,我创建一个静态库)。要创建静态库,我所做的是将cocos2d项目添加到我的工作区,让我的项目链接到cocos2d链接到的库,就是这样。在此更新之前,这一切都很好,但现在有一个警告。

The target which generates this warning is the cocos2d-iphone v2 static library (rather than use cocos2d templates, I create a static library). To create the static library all I did was add the cocos2d project to my workspace, have my project link to the libraries that cocos2d links to, and thats it. This all worked fine prior to this update, but now there is a warning.

如何解决这个问题?我不想搞砸cocos2d项目,因为有一些项目,我使用cocos2d模板而不是静态库。

How do I fix this ? I do not want to mess with the cocos2d project, because there are some projects in which I use the cocos2d template and not the static library.

推荐答案

静态库目标无法链接到dylib。以前,这只是被忽略。您需要从静态库目标中删除所述dylib,并且如果需要,将其添加到构建实际应用程序的每个目标。

Static library targets can not link against dylibs. Previously this was simply ignored. You need to remove said dylib from the static library target and, if necessary, add it to each target that is building the actual app.

查看链接二进制库构建阶段。知道cocos2d可能有一个其他链接器标志-lz,你需要从cocos2d目标的构建设置中删除。

Look into the Link Binary with Libraries Build Phase. Knowing cocos2d there's probably an Other Linker Flag "-lz" that you need to remove from Build Settings of the cocos2d target.

更多推荐

如何修复“是动态库,而不是添加到静态库”警告?

本文发布于:2023-08-07 22:36:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1322190.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:静态   而不是   动态

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!