Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 7511 [details]
dylib settings in Xcode, showing the two different version settings
This bug is with the latest MonoMac, not Xamarin.Mac, maybe it's fixed with Xamarin. . .
At runtime, I had a linked dylib referencing another dylib (SDL2_image linking SDL2) and failing --
running my .exe with mono with debug I got this output from the console:
Mono: DllImport error loading library '/Users/troy/Projects/FNATest/FNATest/bin/Debug/libSDL2_image-2.0.0.dylib': 'dlopen(/Users/troy/Projects/FNATest/FNATest/bin/Debug/libSDL2_image-2.0.0.dylib, 9): Library not loaded: /Users/troy/Frameworks/SDL2.framework/SDL2
Referenced from: /Users/troy/Projects/FNATest/FNATest/bin/Debug/libSDL2_image-2.0.0.dylib
Reason: Incompatible library version: libSDL2_image-2.0.0.dylib requires version 3.0.0 or later, but SDL2 provides version 0.0.0'
(A blank compatibility version in the SDL framework Xcode settings maps to 0.0.0)
Rebuilding /Users/troy/Frameworks/SDL2.framework/SDL2 with compatibility version set to 1.2.3 would change the output to:
Reason: Incompatible library version: libSDL2_image-2.0.0.dylib requires version 3.0.0 or later, but SDL2 provides version 1.2.3'
which gave me the clue about what the problem here was.
Rebuilding SDL with a ompatibility version of 3.1, fixed the problem, but Mono should look at the "version" proper, not the "compatibility version" for determining a legal link, since the compatibility version specifies the minimum API level supported, not the maximum.
The error message isn't from Mono itself, it comes from the native dlopen method (mono just prints the output of dlerror after dlopen failed).
This means the bug is in OSX and that should easily be able to reproduce it by writing a small C program that just dlopens your library.
If that's not the case, then please attach a test case we can use to reproduce the bug.
Oops, I see the SDL_image.dylib was built against SDL.dylib of minimum version 3.0.0.
dlopen()'s error message is cryptic, the versioning system is convoluted, and OS X docs are unclear, but that's not Mono's fault.