Missing library file: libSM.6.dylib When executing an application I receive the following error:

./WordMaker WordMaker_BatchConfig.moos
dyld: Library not loaded: /opt/local/lib/libSM.6.dylib
  Referenced from: /Users/josh/Desktop/FabMapV2_MacOSX/bin/./WordMaker
  Reason: image not found


It appears that this library file relates to X11, which I have installed (i.e. XQuartz), however it is located at /usr/X11/lib/.

How do I fix this problem? Do I simply create a symbolic link to it or is there a better way / something that I am missing?

I am running OS X 10.8.4.
As the library is in /opt/local this probably means that the WordMaker executable was compiled using Macports libraries. So you need to install the libSM library via Macports like this.

sudo port install xorg-libsm