Thursday, June 19, 2008

Getting the ZLib dylib to link in XCode

With the link errors dropping into the 50s the home straight of something that links, though not close, seems possible. My latest teaser was some problems linking Zlib. The Cello sources include Zlib but as it exists as standard under OSX there seemed little point in compiling it into the application - also I dimly remember that there was some issue with it compiling - not that large but using the built in zlib seemed the easiest option.

Working through the link errors I came to some errors from ZLib. Adding the library libz.dylib is just a matter of dragging it in - but the link errors were not resolved. Using Google I found someone with exactly the same problem on Apple's XCode list mailing list - with a reply from Chris Espinosa but infuriatingly my guess was that the final correspondence between them happened off-list.

I eventually figured out the solution - XCode does not set the file type correctly. Just select the dylib, choose Get Info, and set the file-type.

No comments: