[Mono-osx] P/Invoke: Can't find dylib no matter what my configuration is

Kibiz0r kibiz0r at gmail.com
Sat Feb 13 00:47:45 EST 2010

I'm at my wit's end. I can p/invoke other dylibs just fine, and I can use
this dylib just fine from C, but something isn't working here.

The dylib is here: /usr/local/lib/liballegro-4.9.16.dylib

My binding looks like this:
public class Allegro
    [DllImport("allegro-4.9.16.dll", EntryPoint = "al_get_allegro_version")]
    public static extern uint GetVersion();

And I've got a .config like this:
<dllmap dll="allegro-4.9.16.dll"
target="/usr/local/lib/liballegro-4.9.16.dylib" os="osx" />

When I try to do Allegro.GetVersion(), I get System.DllNotFoundException:

This is the output from otool -L /usr/local/lib/liballegro-4.9.16.dylib:
liballegro-4.9.16.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility
version 45.0.0, current version 1038.25.0)
 /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility
version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility
version 1.0.0, current version 1.0.0)
 /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility
version 1.0.0, current version 1.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version

I've tried using various combinations of DllImport and dllmap, but nothing
I tried setting DYLD_LIBRARY_PATH, but that didn't help. (I can p/invoke
other dylibs from the same directory anyway.)

Michael Harrington | Software Apprentice
Atomic Object | http://atomicobject.com
[Ph] +1 616 776 6020 [Fx] +1 616 776 6015
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20100213/7c549ef8/attachment.html 

More information about the Mono-osx mailing list