• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: zlib link error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: zlib link error


  • Subject: Re: zlib link error
  • From: Chris Espinosa <email@hidden>
  • Date: Thu, 20 Oct 2005 08:34:11 -0700


On Oct 20, 2005, at 12:08 AM, Eric Albert wrote:

I am having problem using zlib with 1.4u SDK. I read it up in the list archive and find that I should use "-lz" linker flags. I did that but I am getting this error:

/usr/bin/ld: Undefined symbols:
_compress
_uncompress
collect2: ld returned 1 exit status

This happens even after I change SDK back to Current Mac OS.

Are you importing/including the header file?

In your project, you may wish to add libz.dylib to the project along with the header file instead of specifying "-lz" or you could also add "-I/usr/lib/zlib.h"

All the source files compile fine, so the header must be included. Adding libz.dylib to project causes link error since it resolves to libz.1.2.3.dylib which is not in 1.4u SDK.

For the time being, you can work around this by adding "-lz" to your Other Linker Flags and removing libz.dylib from your project. I believe this is fixed in an upcoming Xcode release.

No, not -lz. You need -l/usr/lib/zlib.dylib. The problem is that Xcode is over-aggressively resolving the symlink. That's the part that's fixed in the next update. But the -lz option does the same thing. The only way to avoid resolving the symlink at link time, and specify that "I want to link against whatever the symlink points to at runtime," is to pass the full path to the symlink.


Chris

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: zlib link error
      • From: "Sean McBride" <email@hidden>
References: 
 >zlib link error (From: Stephen Chu <email@hidden>)
 >Re: zlib link error (From: "D. Walsh" <email@hidden>)
 >Re: zlib link error (From: Stephen Chu <email@hidden>)
 >Re: zlib link error (From: Eric Albert <email@hidden>)

  • Prev by Date: dylib install name, install_name_tool
  • Next by Date: Re: I can't build with Xcode 2.2_preview3_8m639_018213953
  • Previous by thread: Re: zlib link error
  • Next by thread: Re: zlib link error
  • Index(es):
    • Date
    • Thread