Re: Dynamic linking external libs
Re: Dynamic linking external libs
- Subject: Re: Dynamic linking external libs
- From: "MSP Kyle" <email@hidden>
- Date: Tue, 17 Apr 2007 11:00:16 -0400
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.
email@hidden