Message: 4
Date: Tue, 01 Jul 2008 12:32:29 +0200
From: Martin Costabel <email@hidden>
Subject: Re: another port (dynamic libraries?) problem
To: email@hidden
Cc: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Gordon Sarty wrote:
Thanks. I fixed the executable with install_name_tool. I have no idea
how I managed to link against the library build location.
I am sure you didn't. You used, correctly, the build flag "-framework
SDL". With this, the linker looks in /Library/Frameworks/SDL.framework
for a library named SDL. This is where you installed it, so this works.
The path to the library that is stored in the resulting executable is,
however, determined not by the actual location of the library, but by
the install_name stored in the library, which in your case was different
from its actual path. Look at
otool -L /Library/Frameworks/SDL.framework/SDL
So what you should fix with install_name_tool is not your executable,
but the library. Otherwise you will have the same problem again next time.
OTOH, there must be a bug somewhere. Your executable should have found
the library without any fix, because according to man dyld, the
environment variable DYLD_FALLBACK_FRAMEWORK_PATH contains by default
/Library/Frameworks, and that's where it looks when it does not find the
framework at its install_name nor at other standard places. So either
you have set the environment variable DYLD_FALLBACK_FRAMEWORK_PATH to
something not containing /Library/Frameworks, or there is a bug in dyld
(which is what I would bet on).