I\'m using some external codes from google in my new Swift 2.0 project that required \"libz.dylib\" in earlier versions. After updating to the new Xcode / the new SDK.
Meanwhile you can use previous SDK. This is my answer for libsqlite3:
https://stackoverflow.com/a/30981161/627794
Edit: (link content added)
Open terminal, type (change to your desired library, e.g. libz)
locate libsqlite3.dylib
You'll find several files like these:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib/libsqlite3.dylib
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libsqlite3.dylib
Go to your project's setting -> Build Phases -> Link with Binaries. Add BOTH files by clicking +
, then Add Other
. Hit Cmd-Shift-G
, and copy-paste the file path. Click Open
.
If you install sqlite3 using macports, remove /opt/local/lib
from Library Search Path in Build Settings.
You can also add the lybz.dylib
from "Other Linker Flags" in the Build Settings by adding the argument -lz
.
I had to do this because, using the method where you reference the library from /usr/lib, when I deployed my app to our testers the .dylib library could not resolve and caused the app to crash on launch.