Problem using symlink to ldc2 on OS X

Jacob Carlborg via digitalmars-d-ldc digitalmars-d-ldc at
Thu Sep 18 23:08:35 PDT 2014

On 18/09/14 22:55, Peter Alexander wrote:
> I downloaded this:
> Extracted it, then created a symlink from ~/bin/ldc2 to the extracted
> binary.
> Then, if I run ldc2 from this symlink, I get this:
> dyld: Library not loaded: @executable_path/libconfig++.9.dylib
>    Referenced from: /Users/pja/bin/ldc2
>    Reason: image not found
> Trace/BPT trap: 5
> I've "fixed" it by not creating the symlink and instead just adding the
> ldc2 bin path to my $PATH, but I was wondering if there is anything ldc2
> can do to avoid this (can libconfig++ be statically linked)? Just
> worried that other people might run into the same, scary-looking error
> and abandon ldc2. Would be a shame.

Hmm, looks like it searches for libconfig++ relative to the executable 
path. If I recall correctly that load path can be changed using the 
command line tool "install_name_tool". To be able to use that properly 
LDC can help by building with the "-headerpad_max_install_names" flag.

Alternatively I guess you can just symlink the libconfig++ as well to 
the same location as the symlink for the executable.

Of course, static linking would be easiest.

/Jacob Carlborg

More information about the digitalmars-d-ldc mailing list