Re: Xcode 1.5 app runnable on i386 hardware?
Re: Xcode 1.5 app runnable on i386 hardware?
- Subject: Re: Xcode 1.5 app runnable on i386 hardware?
- From: "John Faith" <email@hidden>
- Date: Fri, 14 Sep 2007 12:15:02 -0600
On 9/13/07, John Faith <email@hidden> wrote:
> On 9/13/07, Nick Zitzmann <email@hidden> wrote:
> >
> > On Sep 13, 2007, at 5:21 PM, John Faith wrote:
> >
> > > I checked settings in Xcode and "Library Style" is set to "Static".
> > > Do I need something else to guarantee that libpng.a will be used?
> >
> > The linker is probably finding a dynamic library by that name and
> > using it instead. The linker always prefers dynamic libraries over
> > static libraries, and I'm not aware of any command that reverses this.
> >
> > So try putting the path to libpng.a in the other linker flags and
> > make it so the project doesn't link against it.
> >
>
> I added the path to the static library in the linker settings, but got
> a conflict with the symbol _crc32 defined in /usr/lib/libz.1.dylib. I
> found some other descriptions on how to incorporate static libs, so
> I'll play around and see if I can find a way.
>
Just to follow up, I was able to get libpng to link statically with
this procedure:
- Added '-lpng and -lz' to the linker flags.
- Copied just the Darwinports static libs to a new directory. Note
that I used 'cp -p' to preserve the date on the files, otherwise I got
an error about the library being out of date (ranlib did not work for
some reason).
- Added '-L' for the new directory.
- Built in Xcode.
After building, 'otool -L' showed that the libpng .dylib was no longer
needed, but I did see that libz was dynamically linked. I assume this
was because is was found in the default library path before my
static-only directory, and I hope this will not matter since the
target machine should already have /usr/lib/libz.dylib.
,
JF
_______________________________________________
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