[Mono-list] DllImport error loading library '(null)

Tristan Zajonc tristanz at gmail.com
Tue Oct 12 12:24:38 EDT 2010


Hi,

I'm trying to use the C# ZeroMQ bindings. However on Mono 2.8 and OSX
10.6.4, when I try to run an example application, I get a DLLImport error.
Specifically:

Unhandled Exception: System.DllNotFoundException: libzmq
  at (wrapper managed-to-native) ZMQ/C:zmq_init (int)
  at ZMQ+Context..ctor (Int32 io_threads) [0x00000] in <filename unknown>:0
  at local_lat.Main (System.String[] args) [0x00000] in <filename unknown>:0

This method is simply:

    [DllImport("libzmq", CallingConvention = CallingConvention.Cdecl)]
    public static extern IntPtr zmq_init(int io_threads);

When I use MONO_LOG_LEVEL=debug, mono shows it looking for libzmq but
continually failing with things like:

Mono: DllImport loading library: './libzmq.dylib'.
Mono: DllImport error loading library '(null)'.

I've tried moving the libzmq.dylib to the local folder, setting up a
libzmq.dll.config file, and setting DYLD_FALLBACK_LIBRARY_PATH, all to no
avail.

Is there an obvious reason why Mono is failing to find libzmq.dylib, which
is located in /usr/local/lib? And why does the error become "(null)"?

Many thanks for any pointers,
Tristan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20101012/a47c34ec/attachment.html 


More information about the Mono-list mailing list