Re: Universal binary and dynamic lib problem
Re: Universal binary and dynamic lib problem
- Subject: Re: Universal binary and dynamic lib problem
- From: "Peter O'Gorman" <email@hidden>
- Date: Thu, 20 Jul 2006 07:40:20 +0900
On Wed, 2006-07-19 at 14:28 -0700, Mike Cooper wrote:
> I'm trying to convert our app to be a Universal binary and are seeing some
> weird problem with the dynamic libraries we generate. They all have bogus
> references to a library file "/var/tmp//XXXXXXX.out".
>
> Here's a simple test case:
>
> % cat xxx1.c
>
> #include <stdio.h>
>
> extern void SayHello(void)
> {
> printf("Say Hi\n");
> }
> % cc -c -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 xxx1.c
> -o xxx1.o
> % cc -dynamiclib -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc
> -g -o xxx1.dylib xxx1.o
You should use the -install_name flag here to stop the output getting
the default name. Also, file bug, the output file name is documented to
be the install name, but because the compiler is calling the linker
multiple times with temporary output, you get this. The man page should
probably be updated to reflect this.
cc -dynamiclib -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-arch i386 -arch ppc -o xxx1.dylib xxx1.o \
-install_name /libdir/path/xxx1.dylib
Also note that -lxxx1 will not find this library, if you intend to use
it as input to ld, you'll have to specify it as xxx1.dylib on the link
line.
Peter
Attachment:
signature.asc
Description: This is a digitally signed message part
_______________________________________________
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