0

I am trying to compile some source code from Github on Mac OSX El Capitan. I have installed XCode and MacPorts as required and I'm following the build guide at the below URL:-

https://github.com/libyal/libewf/wiki/Building

Unfortunately, when I try to run one of the command line tools, I get the following error:-

dyld: Library not loaded: /usr/lib/libewf.2.dylib
Referenced from: /Users/me/Desktop/libewf/tmp/usr/bin/./ewfmount
Reason: image not found
Trace/BTP trap: 5

When I run, mdfind libewf.2.dylib, it returns the below:-

/Users/me/Desktop/libewf/tmp/usr/lib/libewf.2.dylib

Any suggestions on what is wrong with this? To me, it looks like the .dylib is in the correct location or is it looking at the main /usr directory on my Macbook as opposed to the temporary one I have created in /Users/me/Desktop/libewf

Thanks all

thefragileomen
  • 1,537
  • 8
  • 24
  • 40
  • 1
    SO already has this... http://stackoverflow.com/questions/24993752/os-x-framework-library-not-loaded-image-not-found – Dominic Jun 21 '16 at 15:55
  • I have looked at that link and checked otool out. OTOOL says it cannot open the file "tmp/usr/lib/libewf.2.dylib" (no such file or directory) but mdfind does show the file in "/Users/me/Desktop/libewf/tmp/usr/lib". – thefragileomen Jun 21 '16 at 16:14
  • `DYLD_FALLBACK_LIBRARY_PATH=/Users/me/Desktop/libewf/tmp/usr/lib ./ewfmount` should work. The problem is that on OS X, libraries are always referenced using absolute paths, but you are trying to run the binary from its build path (i.e. it isn't installed yet) and it thus fails to find the library at the location where it would expect it. `DYLD_FALLBACK_LIBRARY_PATH` tells OS X' dynamic loader to additionally search in this directory when it doesn't find the file in its expected location. – neverpanic Jun 22 '16 at 09:58
  • 1
    Oh, and not that it is not a good idea to configure third-party software with `--prefix=/usr/` on modern OS X anymore, because all systems with System Integrity Protection enabled (which will be the majority of 10.11 and up) will not be able to write to `/usr`. Choose `/opt/yourpackage` or `/usr/local` instead. – neverpanic Jun 22 '16 at 10:01

0 Answers0