Previously I covered embedding the mono dylib within a Cocoa application, a similar issue can crop up with:
libMonoPosixHelper.dylib. Out of the box you may come across this exception:
MonoPosixHelper.dll not found
That is easily explained by the mono configuration file:
... <dllmap dll="MonoPosixHelper" target="libMonoPosixHelper.dylib" os="!windows" /> ...
In fact if you built mono you may find that the target has an absolute file system path. If so, change it to the one above otherwise you will referencing your original build path.
What is happening is that attempts by the runtime to load the MonoPosixHelper.dll are mapped to the dylib, but despite the library sitting next to the Mono dylib and other dlls it could not be found. The first port of call may be the solution from last time, changing the install name:
$ install_name_tool -id @executable_path/../Frameworks/libMonoPosixHelper.dylib libMonoPosixHelper-2.0.1.dylib
But this is not enough, the same exception will be thrown. Delving a bit more into the Dynamic Library Developer Docs, one can see that you need to specify a runpath in the
Runpath Search Paths under
Build Settings for the target so it knows where to look for dependency dynamic libraries: