Re: linking problem with SDK dylib vs. system dylib
Re: linking problem with SDK dylib vs. system dylib
- Subject: Re: linking problem with SDK dylib vs. system dylib
- From: Jean-Daniel Dupas <email@hidden>
- Date: Fri, 22 Feb 2008 16:38:15 +0100
Le 22 févr. 08 à 16:31, Guillaume Laurent a écrit :
Hi everyone,
Trying to use libz.dylib in a test project, I came across what seems
to be a bug in XCode 3.0. From reading around I understand that,
theoretically, all I need to do it to add the lib to my project. The
problem is that it only works properly if I add libz.dylib located
in /usr/lib (which requires using Command-Shift-G from the 'Open
File' dialog), and not if I add the one from the SDK.
If I add the one from /Developer/SDKs/MacOSX10.5.sdk/usr/lib, it's
just added to the 'external framework and libraries' part, but then
I still have to manually add the appropriate '-lz' flag to the
linker command (dragging it to the "link" part of the target doesn't
change anything).
On the other hand, if I add the one from /usr/lib, it's instantly
recognized as such, is added to the link part of the target, and the
'-lz' linker flag is generated in the command.
Apparently I'm the only one having encountered this problem :
http://groups.google.com/group/comp.sys.mac.programmer.help/browse_thread/thread/226437534b326b3e
I don't find it very logical that I should be a lib from a "hidden"
location to have it properly handled by the XCode, so I assume this
is a bug.
Anybody has any clues on this ?
You should never add file from the SDK (library, header, ...) Always
use absolute path (/usr/lib) and the Xcode build system will build the
library path according to your SDK root settings.
For exemple, you add the libz.dylib from /usr/lib and select 10.4u
SDK, Xcode will link your product using /${SDK_PATH}/usr/lib/libz.dylib.
_______________________________________________
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