How to fix "is a dynamic library not added to the static library?

I just upgraded to Xcode 5.1, and suddenly a new warning appeared:

/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

The target that generates this warning is the cocos2d-iphone v2 static library (instead of using cocos2d templates, I am creating a static library). To create a static library, all I did was add the cocos2d project to my workspace, link the project with the libraries referenced by cocos2d links. All this worked fine before this update, but now there is a warning.

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

+7
xcode static-libraries cocos2d-iphone
source share
1 answer

Static library objects cannot communicate with dylib. Previously, it was simply ignored. You need to remove the specified dylib from the target static library and, if necessary, add it to each target that creates the actual application.

Take a look at the Binary link with the library build phase. Knowing cocos2d, perhaps there is another Linker -lz flag that you need to remove from the build settings for the cocos2d target.

+11
source share

All Articles