[Mono-osx] Problem building and using a Cocoa .dylib

Hess, Philip J pjhess at purdue.edu
Mon Jan 30 19:57:41 UTC 2012

It's probably actually finding libcairo.dylib in Mono.framework, _not_ the libcairo.dylib in your executable's folder.

Here's some information:


Normally a .dylib would not have any UI stuff in it, so your library probably doesn't need the AppKit.framework.



From: mono-osx-bounces at lists.ximian.com [mono-osx-bounces at lists.ximian.com] On Behalf Of tlapse [tlapse at gmail.com]
Sent: Monday, January 30, 2012 2:32 PM
To: mono-osx at lists.ximian.com
Subject: Re: [Mono-osx] Problem building and using a Cocoa .dylib

The exception is "System.DllNotFoundException: my.dylib"

Same error if I name it "libmy.dylib".

If I copy "libcairo.dylib" from the Mono library to the same location as
my.dylib and use
[DllImport("libcairo.dylib", EntryPoint = "myProc", SetLastError = true,
CallingConvention = CallingConvention.Cdecl)]
It finds the library, but gives the error
"System.EntryPointNotFoundException: myProc" which is to be expected.

So it must be something about the structure of my.dylib. The Xcode project
for it lists Cocoa.framework, AppKit.framework, CoreData.framework and

View this message in context: http://mono.1490590.n4.nabble.com/Problem-building-and-using-a-Cocoa-dylib-tp4341716p4342251.html
Sent from the Mono - OSX mailing list archive at Nabble.com.
Mono-osx mailing list
Mono-osx at lists.ximian.com

More information about the Mono-osx mailing list