[Mono-osx] bmac and dylib question

Raymond Reggers raymond at adaptiv.nl
Mon Feb 6 15:51:43 UTC 2012


Hi all,

I've just started out using MonoMac and I managed to get bmac working (at least I hope). What I don't understand is how to include a .dylib in my MonoMac project. So my problem is like this:

- Checked out the latest MonoMac and MonoCore repos.
- I've set up a MonoMac project in MonoDevelop and got it to run (great stuff by the way).
- Created an Xcode project with a single class:

@interface Test123 : NSObject

- (NSString *)test;

@end

- Compiled it to a dylib.
- For binding purposes I created a file called Test.cs containing:

using MonoMac.Foundation;
using MonoMac.AppKit;

namespace Test
{
	[BaseType (typeof (NSObject))]
	interface Test123
	{
		[Export ("test")]
		string test();
	}
}

- Using bmac I managed to create Test.dll.
- Now in my MonoMac project this works:

Test123 test = new Test123()

- Calling the method "test" however won't work:

test.test();
 
I guess this is most likely caused because my dylib is not referenced? But how should I include this dylib in my MonoMac project?

I've tried using "Add native reference" in my MonoMac project. But this doesn't seem to work. I also read about including gcc_flags like this for example:

-gcc_flags "-L${ProjectDir} -lMylibrary -force_load -lSystemLibrary -framework CFNetwork -ObjC"

Where should I add these in my MonoDevelop / MonoMac project? 

Thanks!

Raymond



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-osx/attachments/20120206/0c2f0871/attachment.html>


More information about the Mono-osx mailing list