I have built an executable (named demux) on OS X that always fails to load and I cannot find why:
$ ./demux
RPATH failed to expanding @rpath/sfeMovie.framework/Versions/2.0/sfeMovie to: @executable_path/sfeMovie.framework/Versions/2.0/sfeMovie
dyld: Library not loaded: @rpath/sfeMovie.framework/Versions/2.0/sfeMovie
Referenced from: …current_dir/./demux
The framework is next to the executable. Otool shows the following :
$ otool -L sfeMovie.framework/Versions/2.0/sfeMovie
sfeMovie.framework/Versions/2.0/sfeMovie:
@rpath/sfeMovie.framework/Versions/2.0/sfeMovie (compatibility version 2.0.0, current version 2.0.0)
And:
$ otool -L demux
demux:
@rpath/sfeMovie.framework/Versions/2.0/sfeMovie (compatibility version 2.0.0, current version 2.0.0)
Given that, I thought that adding @executable_path to the runtime search path of the executable would allow it to look at any framework and library whose relative install name is simply prefixed with @rpath (like in @rpath/sfeMovie.framework/…) and which is next to the executable. To make sure that this runtime search path is correct:
$ otool -l demux | grep LC_RPATH -A 2
cmd LC_RPATH
cmdsize 32
path @executable_path (offset 12)
But this fails and I don't know why. To me @executable_path/sfeMovie.framework/Versions/2.0/sfeMovie looks like the correct path but it still fails… is there any misuse of @rpath or @executable_path?