• 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: How to make a program look for dylibs other than /usr/local/lib?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make a program look for dylibs other than /usr/local/lib?


  • Subject: Re: How to make a program look for dylibs other than /usr/local/lib?
  • From: Peter O'Gorman <email@hidden>
  • Date: Fri, 07 Dec 2007 10:21:01 -0600

parag vibhute wrote:
> I am also facing certain type of problem. I tried two ways. First
> scenario is as follows
> 1. Dynamic library's install name is /usr/lib/libopbx.dylib.
> 2. I set extension of source file (which is using that dynamic library)
> to cpp & placed that dynamic library at executable path.
> 3. In cpp file I am loading dynamic library at run time i.e. using
> dlopen, dlclose etc. functions.(i.e. treating dynamic library is dynamic
> dependant library)
> 3. Compilation is successful.
> 4. Now if I change extension to mm, it gives me error.
> 5. But with cpp, there is one function for which I get error
> "/usr/bin/ld: Undefined symbols:"

Sorry, but there is not enough information here to give you a reasonable
guesstimate about what went wrong. What are the undefined symbols? Can
you post a short code snippit that demonstrates the problem? Could you
show the build log?

>
> Second scenario is
> 1. Dynamic library's install name is /usr/lib/libopbx.dylib.
> 2. I set extension of source file (which is using that dynamic library)
> to mm & placed that dynamic library at root("/") path.
> 3. Now this time I am loading dyamic library at launch of my application
> using -l flag of gcc(i.e. treating dynamic library as dependant library)
> 3. Compilation is successful.
> 4. Now I set value of DYLD_LIBRARY_PATH to "/"
> 5. Run the code, it was successful.
> 4. And also I do not get error for the function which I was getting in
> first scenario.
>
> I am using Xcode 2.4.1 to build the application.
>
> My requirement is to avoid setting value of variable DYLD_LIBRARY_PATH;
> for that I require to follow first path but in that case I am getting
> error for a certain function. What should I do?

Setting DYLD_LIBRARY_PATH to / is both strange and unnecessary. I assume
that you want to have the library somewhere relative to the executable,
in which case you should read earlier posts and manpages.

Peter
--
Peter O'Gorman
http://pogma.com
 _______________________________________________
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

  • Follow-Ups:
    • Re: How to make a program look for dylibs other than /usr/local/lib?
      • From: "parag vibhute" <email@hidden>
References: 
 >How to make a program look for dylibs other than /usr/local/lib? (From: Graham Reitz <email@hidden>)
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: Peter O'Gorman <email@hidden>)
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: Graham Reitz <email@hidden>)
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: Peter O'Gorman <email@hidden>)
 >Re: How to make a program look for dylibs other than /usr/local/lib? (From: "parag vibhute" <email@hidden>)

  • Prev by Date: Re: Creating / Editing Xcode project templates.
  • Next by Date: Re: remembering cursor position
  • Previous by thread: Re: How to make a program look for dylibs other than /usr/local/lib?
  • Next by thread: Re: How to make a program look for dylibs other than /usr/local/lib?
  • Index(es):
    • Date
    • Thread