• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Linking a lib in XCode (Jean-Daniel Dupas)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking a lib in XCode (Jean-Daniel Dupas)


  • Subject: Re: Linking a lib in XCode (Jean-Daniel Dupas)
  • From: Terry Simons <email@hidden>
  • Date: Thu, 13 Mar 2008 06:40:31 -0600

I'm not sure about when you add a dylib to your project, but if you use the old-school ;) method of using -l linker options in your targets, then you can split it out by using different -L paths for release vs debug and then it should link the appropriate "foo" library with -lfoo.

- Terry

On Mar 13, 2008, at 6:33 AM, Roni Music wrote:



Message: 1
Date: Thu, 13 Mar 2008 09:17:03 +0100
From: Jean-Daniel Dupas <email@hidden>
Subject: Re: Linking a lib in XCode
To: Mark Haskins <email@hidden>
Cc: Xcode Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes


That -lxml with a lower case L, not an upper case i.
In fact, you do not have to add this linker flag. Xcode do it already
when you add libxml.dylib in your target.


that leads to another question:

I'm adding a .dylib to my target which works fine.

But how can I add the debug version of the dylib for my development/ debug build
and the release version of the dylib for my deployment/release build?


is this at all possible?


Thanks, Rolf



And you can also remove the '/usr/include/libxml2/**' entry in your
search path, it is useless.


Le 13 mars 08 à 09:02, Mark Haskins a écrit :

Thanks for the responses guys.

I added   /usr/include/libxml2  and   /usr/include/libxml2/**  to
the 'Header Search Paths' in the Project Get Info dialogue and the
error went away. Looks like I need to read up more on the working of
XCode and GCC. Those Linux days are long in the past :)

When I added  -lxml  to the 'Other Linker Flags' setting I got an
error about unknown option. I guessed this might be the place to put
it based on the wording in George's email, but I probably wrong.

Anyhow thanks for the help

Mark


On Thursday, March 13, 2008, at 02:23AM, "Terry Simons" <email@hidden > wrote:
Based on the error it looks like Mark's code is trying to reference
the libxml2 header directory from /usr/include/libxml2... so it
should
be /usr/include/libxml2 (or /usr/include/libxml2/**) not /usr/
include/
libxml2/libxml/** which would expand to: /usr/include/libxml2/ libxml/
libxml/xmlmemory.h if he's doing something like:


#include <libxml/xmlmemory.h>

Which is what it looks like to me.  ;)

- Terry

On Mar 12, 2008, at 7:31 PM, George Warner wrote:

On Wed, 12 Mar 2008 19:52:40 +0000, Haskins Mark <email@hidden
>
wrote:
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.

Cut and paste these into your project or target settings (for all configurations):

HEADER_SEARCH_PATHS = /usr/include/libxml2/libxml/**
OTHER_LDFLAGS = -lxml

--
Enjoy,
George Warner,
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)


_______________________________________________ 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

_______________________________________________ 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
References: 
 >Re: Linking a lib in XCode (Jean-Daniel Dupas) (From: "Roni Music" <email@hidden>)

  • Prev by Date: Re: Linking a lib in XCode (Jean-Daniel Dupas)
  • Next by Date: CFBundleGetFunctionPointerForName
  • Previous by thread: Re: Linking a lib in XCode (Jean-Daniel Dupas)
  • Next by thread: CFBundleGetFunctionPointerForName
  • Index(es):
    • Date
    • Thread