[Mono-osx] bmac and dylib question

Eduardo Jimenez barkley at eclipse-games.net
Mon Feb 6 16:38:11 UTC 2012


Don't get my word on it, but I believe that adding the following gcc 
flags line may help, assuming you name your library 'libMyLibrary.dylib' 
and tiy copy it to your project directory:

|-gcc_flags ||"-L${ProjectDir} -lMylibrary -force_load 
${ProjectDir}/libMyLibrary.dylib -ObjC"|

Hope it helps!

Eduardo


On 2/6/2012 4:51 PM, Raymond Reggers wrote:
> 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;
>
> namespaceTest
> {
> [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
>
>
>
>
>
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx

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


More information about the Mono-osx mailing list