• 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: Dynamic linking external libs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic linking external libs


  • Subject: Re: Dynamic linking external libs
  • From: "MSP Kyle" <email@hidden>
  • Date: Tue, 17 Apr 2007 11:29:19 -0400

dhcp-23-149:/opt/local/lib $ ls -al libgui*
-rwxr-xr-x   2 root  admin    50752 Apr 16 02:13 libguile-ltdl.1.0.1.dylib
lrwxr-xr-x   1 root  admin       25 Apr 16 02:13 libguile-ltdl.1.dylib -> libguile-ltdl.1.0.1.dylib
-rw-r--r--   2 root  admin    66840 Apr 16 02:13 libguile-ltdl.a
lrwxr-xr-x   1 root  admin       25 Apr 16 02:13 libguile-ltdl.dylib -> libguile-ltdl.1.0.1.dylib
-rwxr-xr-x   2 root  admin      888 Apr 16 02:13 libguile-ltdl.la
-rwxr-xr-x   2 root  admin  1008656 Apr 16 02:13 libguile.12.3.1.dylib
lrwxr-xr-x   1 root  admin       21 Apr 16 02:13 libguile.12.dylib -> libguile.12.3.1.dylib
-rw-r--r--   2 root  admin  1768296 Apr 16 02:13 libguile.a
lrwxr-xr-x   1 root  admin       21 Apr 16 02:13 libguile.dylib -> libguile.12.3.1.dylib
-rwxr-xr-x   2 root  admin      889 Apr 16 02:13 libguile.la
...

dhcp-23-149:/opt/local/lib $ otool -L libguile-ltdl.1.0.1.dylib
libguile-ltdl.1.0.1.dylib:
        /opt/local/lib/libguile-ltdl.1.dylib (compatibility version 2.0.0, current version 2.1.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0 , current version 88.1.8)


-k

On 4/17/07, Mike Jackson <email@hidden> wrote:
Do you have the following library installed in the location specified?

/opt/local/lib/libguile-ltdl.1.dylib

libguile is linked to that library and my guess is that LD can not find that library?
-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Apr 17, 2007, at 11:00 AM, MSP Kyle wrote:

Ld /Users/kyle/Op2/build/Debug/IWall.app/Contents/MacOS/IWall normal ppc
    mkdir /Users/kyle/Op2/build/Debug/IWall.app/Contents/MacOS
    cd /Users/kyle/Op2
    /usr/bin/gcc-4.0 -o /Users/kyle/Op2/build/Debug/IWall.app/Contents/MacOS/IWall -L/Users/kyle/Op2/build/Debug -L/opt/local/lib -F/Users/kyle/Op2/build/Debug -filelist /Users/kyle/Op2/build/OpenWeb.build/Debug/OpenWeb.build/Objects-normal/ppc/IWall.LinkFileList -framework Cocoa -framework OpenGL -arch ppc -Wl,-Y,1455 -mmacosx-version-min= 10.4 -lguile -isysroot /Developer/SDKs/MacOSX10.4u.sdk
/usr/bin/ld: warning can't open dynamic library: /Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib/libguile-ltdl.1.dylib referenced from: /opt/local/lib/libguile.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)

On 4/17/07, Mike Jackson <email@hidden > wrote:
Can you post the full linker command so that we can see it?
-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Apr 17, 2007, at 10:34 AM, MSP Kyle wrote:

Mike,

Thanks for the response.

I've checked that, too...

$ otool -L /opt/local/lib/libguile-ltdl.1.dylib
/opt/local/lib/libguile-ltdl.1.dylib:
        /opt/local/lib/libguile-ltdl.1.dylib (compatibility version 2.0.0, current version 2.1.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.8)


-k

On 4/17/07, Mike Jackson < email@hidden> wrote:
What I think is happening is that the person who compiled the  libguile-ltdl.1.dylib on DarwinPorts didn't quite do it correctly. Run the following command from the terminal:

otool -L /opt/local/lib/libguile- ltdl.1.dylib

Then look at the output. The first entry will give you the "install name" which should be /opt/local/lib/libguile- ltdl.1.dylib, but I think it has /Developer/SDKs/MacOSX10.4u.sdk/ prepended to it. If this is the case then you have two choices. Contact the developer and have them fix their build script/environment to have the install name set to /opt/local/lib OR you can use "install_name_tool" to change the install_name embedded in the library.

There is a man page for install name, give it a read. The tool is pretty straight forward to use.

Hope that helps.
-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Apr 17, 2007, at 9:57 AM, MSP Kyle wrote:

Mike,

Actually, I've already got /opt/local/lib and /opt/local/include set up in my configuration. The problem persists.

-k

On 4/17/07, Mike Jackson <email@hidden > wrote:
You probably need to add /opt/local to the library path for your Project/Target. Double click on your Target in Xcode and then click on the second tab. Within the top 10 entries there is one for use library search path. Edit that to contain /opt/local/lib. Note that this is a _per configuration_ setting. So set it for both debug and release.

Hope that helps.
-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services


On Apr 17, 2007, at 2:52 AM, MSP Kyle wrote:

Hi,

I've read a number of entries regarding (what I believe) to be an issue that Xcode has with dynamic libraries in custom locations.  What I'm attempting to do is simple.

I've downloaded a set of libraries via DarwinPorts into /opt/local, and would like my Xcode project to link to the libraries found in /opt/local/lib. The warning I get from the compiler turns out to be the cause of a real problem:

Ld ::
...
 -mmacosx-version-min=10.4 -lguile -isysroot /Developer/SDKs/MacOSX10.4u.sdk
/usr/bin/ld: warning can't open dynamic library: /Developer/SDKs/MacOSX10.4u.sdk/opt/local/lib/libguile-ltdl.1.dylib referenced from: /opt/local/lib/libguile.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)

/Developer/SDKs/MacOSX10.4u.sdk is being prepended to the reference found in /opt/local/lib/libguile.dylib. Is there a straightforward way to get around this?

I've read of solutions involving install_name_tool, but haven't been able to wrap my head around how that would solve this problem.

Can anyone nudge me in the direction of a solution?

Thanks.

-k


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
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: 
 >Dynamic linking external libs (From: "MSP Kyle" <email@hidden>)
 >Re: Dynamic linking external libs (From: Mike Jackson <email@hidden>)
 >Re: Dynamic linking external libs (From: "MSP Kyle" <email@hidden>)
 >Re: Dynamic linking external libs (From: Mike Jackson <email@hidden>)

  • Prev by Date: Re: Dynamic linking external libs
  • Next by Date: Complex Subversion setup help needed
  • Previous by thread: Re: Dynamic linking external libs
  • Next by thread: Re: Dynamic linking external libs
  • Index(es):
    • Date
    • Thread