[Mono-osx] Beginner - Very Simple P/Invoke Example?
duane at wandless.net
Mon Jan 4 10:42:11 EST 2010
I recommend the dllmap approach when embedding. I could not get any of the
environment variables to be correctly set and read at runtime. I'd set it
during the app load routine, init mono and mono would fail to find the
library. If I set the environment variable prior to launching the app mono
could find the library. Using the dllmap I'm able to set at runtime where
my dylib is located, which is within the app itself.
On Mon, Jan 4, 2010 at 3:40 AM, Michael Hutchinson <m.j.hutchinson at gmail.com
> On Sun, Jan 3, 2010 at 5:15 PM, cannyshammy <mike.cann at gmail.com> wrote:
> > Im new to Mono development tho I have done a fair bit of XNA stuff. For
> > current project however I need to catch system-wide input events so I
> > some native code for that.
> > Im trying to get a very simple P/Invoke example working on OSX. My C
> > like:
> > But it throws me the following error:
> > Unhandled Exception: System.DllNotFoundException: libXCodeMono.dylib
> > at (wrapper managed-to-native) SimpleMacMonoHook.MacHook:myMethod (int)
> > at SimpleMacMonoHook.MacHook..ctor () [0x00006] in
> My guess would be that when loading dynamic libraries, MacOS isn't
> looking in the directory your program's in. Try setting
> DYLD_FALLBACK_LIBRARY_PATH to your program's directory in your launch
> AFAIK the "done thing" for library paths on Mac is to use absolute
> paths, with some variables - the following explains this:
> With Mono, I'd use dllmaps and DYLD_FALLBACK_LIBRARY_PATH.
> Michael Hutchinson
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-osx