Re: Linking a lib in XCode
Re: Linking a lib in XCode
- Subject: Re: Linking a lib in XCode
- From: Jean-Daniel Dupas <email@hidden>
- Date: Wed, 12 Mar 2008 23:02:26 +0100
Le 12 mars 08 à 20:52, Haskins Mark a écrit :
I'm struggling to do something which should be very simple and I've
probably missed something somewhere along the way.
I'm writing an application that uses XML, and I am attempting to add
the libxml2.2.dylib library to the project as I believe that this
will resolve my
error: libxml/xmlmemory.h: No such file or directory
error.
I have tried adding it as an 'existing framework', and leaving it at
the root of the tree, I have tried moving the library under the
'Linked Frameworks' folder. I have tried adding it as an 'existing
File'.
I'm reasonably new to Xcode and I have been looking at an existing
application called SeismicXML (which is an example application for
the iPhone) for guidance. When I run that application everything
builds correctly. I am linking to the same version of the
libxml2.2.dylib file that it is using, (its the only one one the
computer as far as I can see).
Can anyone shed some insight as to where I might be going wrong?
Thanks
Adding the library in your Xcode project only tell the linker it have
to use it when it links your binary.
Your error is a compiler error, not a linker error (a linker error
would be 'symbol xxx not found' or something like that)
You have to add /usr/lib/libxml2 to your header search path (see
Header Search Path" build setting) to tell the compiler to search .h
files in the right place.
Note that most of the time, headers are already in the right place,
but for some reason (probably historical reasons), the libxml require
that you edit the header search path each time you want to use it in a
project. _______________________________________________
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