我刚刚升级到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.
更多推荐
如何修复“是动态库,而不是添加到静态库”警告?
发布评论