[Mono-osx] Incorrect DllNotFoundException (BUG?)

Yoav HaCohen yoavhacohen at gmail.com
Fri Jul 31 09:38:52 EDT 2009


I'm trying to call an OpenCV function using P/Invoke method from C#, but I
get DllNotFoundException although the file exists on the disk.

I managed to call functions that are in the libcxcore.1.1.1.dylib library,
but I get the above exception for functions that are in
libhighgui.1.1.1.dylib (another opencv binary file).
Both files (libcxcore.1.1.1.dylib and libhighgui.1.1.1.dylib) are on the
same directory and I'm sure that the file libhighgui exists (I use "ls

The P/Invoke method is:

[DllImport(HIGHGUI_LIBRARY, EntryPoint = "cvNamedWindow")]
private static extern int _cvNamedWindow([MarshalAs(_stringMarshalType)]
String name, int flags);

where HIGHGUI_LIBRARY="/Volumes/Data/Dev/opencv/libhighgui.1.1.1.dylib"
(hard coded)

I compiled opencv by myself from its latest SVN version, and managed to pass
all tests (include c++ examples that requires 
libhighgui.1.1.1.dylib ).

Even if I have a problem in my library, DllNotFoundException is not the
correct exception to raise, because the file exists on the disk.

I run it from the latest version of MonoDevelop (Mac preview) and using Mono on Mac OS 10.5.7

Can I step-by-step debug Mono from MonoDevelop to see when and why the
exception is raised?

Any ideas what else can cause a DllNotFoundException to be raised otherwise
than file doesn't exists?

Thanks in advance,
View this message in context: http://www.nabble.com/Incorrect-DllNotFoundException-%28BUG-%29-tp24756611p24756611.html
Sent from the Mono - OSX mailing list archive at Nabble.com.

More information about the Mono-osx mailing list