Redefined symbols in linked dylibs
Redefined symbols in linked dylibs
- Subject: Redefined symbols in linked dylibs
- From: "Ben Kennedy" <email@hidden>
- Date: Sat, 25 Oct 2003 21:45:53 -0400
- Organization: Zygoat Creative Technical Services
Hello all,
I've just brought my pbxproj into xcode and am rebuilding it. The linker
is giving me a raft of "warning multiple definitions of symbol" messages
while linking against libz and libcrypto, which heretofore had never occurred.
The link phase looks like this:
/usr/bin/gcc-3.3 -o /Zygoat/Doggiebox/source/build/Doggiebox.app/
Contents/MacOS/Doggiebox "-L/Zygoat/Doggiebox/source/build" "-Lbuild/
libsndfile/lib" "-F/Zygoat/Doggiebox/source/build" "-F./build" "-F/
System/Library/Frameworks" -filelist /Zygoat/Doggiebox/source/build/
Doggiebox.build/Doggiebox.build/Objects-normal/LinkFileList "-arch"
"ppc" "-prebind" "-Wl,-no_arch_warnings" "-framework" "Carbon" "-
framework" "ZygoatAudio" "-lcrypto.0.9" "-lz.1.1.3" "-framework" "Cocoa"
And the errors look like this:
ld: warning multiple definitions of symbol _deflateParams
/usr/lib/libz.1.dylib(deflate.o) definition of _deflateParams
/usr/lib/libz.1.1.3.dylib(deflate.o) definition of _deflateParams
ld: warning multiple definitions of symbol _deflate
/usr/lib/libz.1.dylib(deflate.o) definition of _deflate
/usr/lib/libz.1.1.3.dylib(deflate.o) definition of _deflate
[... for many different symbols ...]
Upon looking in /usr/lib, it appears there are two distinct instances of
libz, one each with the general and precise version numbers:
ben:/usr/lib ben$ ls -l /usr/lib/libz*
-rwxr-xr-x 1 root wheel 56416 24 Sep 02:35 /usr/lib/libz.1.1.3.dylib
-rwxr-xr-x 1 root wheel 56200 24 Sep 02:35 /usr/lib/libz.1.dylib
lrwxr-xr-x 1 root wheel 12 25 Oct 13:52 /usr/lib/libz.dylib ->
libz.1.dylib
It seems like xcode is linking against both of them, despite only the
libz.1.1.3.dylib being specified in the target config.
In an attempt to compare with what might have been the case under 10.2, I
checked out the tree that was removed during my Panther install:
ben:/usr/lib ben$ ls -l /Previous\ Systems/Previous\ System\ 1/usr/lib/libz*
-rwxr-xr-x 1 root wheel 56372 22 Sep 21:57 /Previous Systems/Previous
System 1/usr/lib/libz.1.1.3.dylib
lrwxr-xr-x 1 root wheel 16 11 Sep 2002 /Previous Systems/Previous
System 1/usr/lib/libz.1.dylib -> libz.1.1.3.dylib
lrwxr-xr-x 1 root wheel 16 11 Sep 2002 /Previous Systems/Previous
System 1/usr/lib/libz.dylib -> libz.1.1.3.dylib
As I would have expected, in here there are two symbolic links to the one
actual dylib. I'm somewhat surprised that this is not now the case in /
usr/lib.
What is the difference between libz.1.dylib and libz.1.1.3.dylib (they
are of marginally different sizes)? Is my Panther install somewhat
fux0red, or is this the case on others' machines as well?
And why is xcode linking against two copies of the library when the gcc
commandline gives no suggestion that it ought to be?
-ben
--
Ben Kennedy, chief magician
zygoat creative technical services
613-228-3392 | 1-866-466-4628
http://www.zygoat.ca
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.