<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title></title></head><body><p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">Hello fellow MacPorts enthusiasts,</span></p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">I am new to developing Portfiles and I currently work on my first own port (in a local repository). It configures, builds, destroots and installs two targets: A dynamic library and an executable, the former being linked to the latter.</span></p>
<p style="margin: 0px;"><span style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;text-decoration:none">I can confirm that both are fully working after the port installation.</span></p>
<p style="margin: 0px;">However, as soon as I deactivate the port and reactivate that same port variant, the executable does not work anymore as the library is no longer loaded correctly.</p>
<p style="margin: 0px;">Error:</p>
<p style="margin: 0px; padding-left: 30px;">dyld: Library not loaded: @rpath/libtestmp.dylib</p>
<p style="margin: 0px; padding-left: 30px;"><span class="Apple-converted-space"> </span>Referenced from: /opt/local/bin/bintestmp</p>
<p style="margin: 0px; padding-left: 30px;"><span class="Apple-converted-space"> </span>Reason: image not found</p>
<p style="margin: 0px; padding-left: 30px;">Abort trap: 6</p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">The library itself still works just fine.</p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Performing 'otool -L' on the binary reveals that, indeed, the shared library is no longer loaded correctly (its correct location is /opt/local/lib/libtestmp.dylib):</p>
<p style="margin: 0px 5px 0px 0px; padding-left: 30px;">@rpath/libtestmp.dylib (compatibility version 0.0.0, current version 0.0.0)</p>
<p style="margin: 0px 5px 0px 0px; padding-left: 30px;"> </p>
<p style="margin: 0px 5px 0px 0px;">Manually relinking the shared library with 'install_name_tool' succeeds and fixes the executable.</p>
<p style="margin: 0px 5px 0px 0px;"> </p>
<p style="margin: 0px 5px 0px 0px;">I tried to fix this issue myself and searched for similar problems but I could not find an answer, which is why I am finally writing to this list.</p>
<p style="margin: 0px 5px 0px 0px;">Can you help me with that issue? Am I missing something obvious?</p>
<p style="margin: 0px 5px 0px 0px;"> </p>
<p style="margin: 0px 5px 0px 0px;">Thanks a lot in advance, any help is much appreciated!</p></body></html>