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

Laurent Etiemble laurent.etiemble at gmail.com
Sat Feb 13 04:40:04 EST 2010


Hello,

The first line of the otool output seems suspicious: usually, the first line
is the absolute path of the library, or contains a path lookup directive
(@executable_path for example).

- Can you post the otool output of a library that you can successfully
p/invoke ?
- Have you tried to use the following command line to see what is going on ?

MONO_LOG_LEVEL="debug" MONO_LOG_MASK="dll" mono MyProgram.exe

Regards, Laurent Etiemble.

2010/2/13 Kibiz0r <kibiz0r at gmail.com>

> 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:
> /usr/local/lib/liballegro-4.9.16.dylib
>
> This is the output from otool -L /usr/local/lib/liballegro-4.9.16.dylib:
> /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
> 7.9.0)
>  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
> 125.0.0)
>
> I've tried using various combinations of DllImport and dllmap, but nothing
> works.
> 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
>
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20100213/69bf9d68/attachment-0001.html 


More information about the Mono-osx mailing list