1

I am trying to migrate my project from iOS 8 to iOS 9. Any I am getting some library errors. I am using XCode7-beta6.

Here is how it looks like:

error: /Applications/Xcode-beta 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Applications/Xcode-beta 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/lib/libz.dylib (No such file or directory)

libz.dylib is included in "Link binary with libraries".

Now I know that this dylib is a leftover from past because if I remove it then try to add it again I find tbd files instead of dylib files.

There is an answer here: Link for working around this issue but I have tried adding libz in other linker flags as -libz and also -l. None of them worked.

How can I make the project find the library?

Thanks

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Can Leloğlu
  • 271
  • 1
  • 4
  • 11

3 Answers3

2

This worked for me:

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/lib
sudo cp /usr/lib/libz.dylib .
tleyden
  • 1,942
  • 2
  • 12
  • 17
0

First, upgrade to GM seed and see if the problem goes away.

Failing that, you might be able to reopen the project using the previous version of Xcode (where it won't fail to build), then change the library (in the file inspector) from being project-relative or absolute to being SDK-relative.

Failing that, delete the library and re-add it by clicking the "+" to add frameworks and libraries, then dragging the actual dylib from the SDK root to the resulting open dialog (IIRC). Be sure you hunt down every reference to that library. I recommend using "grep -r" on the contents of the .xcodeproj folder.

dgatwood
  • 10,129
  • 1
  • 28
  • 49
0

Just add libz.tbd, It will solve the problem