Image not found error while trying to run CocoaGlk clients

This post deals quickly with how to solve the issue of seeing an 'Image not found' error while running an application linked to the GlkClient framework.

When you build an executable and link in the GlkClient library, you might see this while trying to run it:

ahunter:.../build/Development % ./tads-3
dyld: Library not loaded: @executable_path/../../../
../Frameworks/GlkClient.framework/Versions/A/GlkClient
  Referenced from: ./build/Development/./tads-3
  Reason: image not found
zsh: trace trap  ./tads-3

The problem is that OS X isn't looking in the right place. You need to override the DYLD_FRAMEWORK_PATH in order to tell OS X where to find the client library.

The easiest thing to do is to copy it to the place where your executable is: the build directory if you're using XCode or the directory you're running the executable from if you're using the terminal. Once you've done this, set the DYLD_FRAMEWORK_PATH environment variable to '.'. In XCode, you can do this by selecting your executables under the 'Executables' section of the project and looking at the 'Arguments' tab of the Info window.