[Mono-osx] Redistributable Mac OSX app without mono using mkbundle2

Laurent Etiemble laurent.etiemble at gmail.com
Mon May 17 09:04:15 EDT 2010


Hello,

Preliminary question: why don't you use the NAnt tasks (<mkappl/> and
<mkbundle/>) available in Monobjc ? They are supposed to do all the dirty
stuff for you (native library gathering, relocation, remapping, etc.). There
is even a tutorial for that:
http://www.monobjc.net/index.php?page=redistribution

For the GLib problem, this is a regression from 2.6.3. The pkg-config file
for Mono is incomplete, as the 2.6 branch still depends on GLib. You can
quick-fix this issue by copying the "mono.pc" file from the 2.6.3
installation.

Regards, Laurent Etiemble.

2010/5/14 dgdw <david.drysdale-wilson at linn.co.uk>

>
> Hi,
>
> I am in the process of trying to produce a Mac application that can be run
> without the need for our users to first install mono - However I am running
> into a lot of issues and I hope that someone here will be able ti give me
> some pointers as to what I am doing wrong.
>
> My development environment is a Mac with Snow Leopard 10.6.3, Mono 2.6.4
> and
> Monobjc 2.0.492.0 and XCode 3.2.1.
>
> So far I have managed to create a working Mac application by creating the
> appropriate .app directory structure, populated it with the required
> assemblies, exe, pInfo and shell script (which invokes my exe with mono).
> The next step is to remove the need to have mono installed.
>
> The first issue I had with mkbundle2 is that the compilation of the auto
> generated assembly fails with the following errors,
>
> as -o temp.o temp.s
> temp.s:2:unknown section type: symbol_stubs
> temp.s:2:Rest of line ignored. 1st junk character valued at 112 (p).
> <snip>
>
> I saw a post about this issue (it appears to be an issue of the assembler
> requiring information about the architecture to compile against), so I set
> the AS environment variable to 'as -arch i386'. Next the compilation fails
> with the following errors,
>
> cc -g a.out -Wall temp.c 'pkg-config --cflags --libs mono'  temp.o
> temp.c: In function 'install_dll_config_files':
> temp.c:47: warning: pointer targets in passing argument 2 of
> 'mono_register_config_for_assembly' differ in signedness
> ld: warning: in
> /Library/Frameworks/Mono.framework/Versions/2.6.4/lib/libmono.dylib, file
> is
> not of required architecture
> <snip>
>
> So I set the CC environment variable to 'cc -arch i386'. Now the
> compilation
> fails with the following errors,
>
> cc -g a.out -Wall temp.c 'pkg-config --cflags --libs mono'  temp.o
> In file included from temp.c:2
>
> /Library/Frameworks/Mono.framework/Versions/2.6.4/include/mono-1.0/mono/metadata/assembly.h:4:18:
> error: glib.h: No such file or directory
> <snip>
>
> The output from 'pkg-config --cflags --libs mono' gives,
>
> -D_THREAD_SAFE
> -I/Library/Frameworks/Mono.framework/Versions/2.6.4/include/mono-1.0
> -pthread -L/Library/Frameworks/Mono.framework/Versions/2.6.4/lib/ -lmono
> -lpthread -lm
>
> No mention of glib, so I looked in the mono.pc file in
> /Library/Frameworks/Mono.framework/Versions/2.6.4/lib/pkgconfig/ and
> discovered the line 'Requires: glib-2.0 gthread-2.0 was commented out. I
> uncommented the line and finally mkbundle2 produces a compiled version of
> my
> exe.
>
> The next step is the use otool to get a list of the mono libraries my
> compiled executable is dependent on, move them to the Frameworks directory
> in my .app directory and fix up the libraries and compiled executable
> library references using install_name_tool.
>
> I theory this .app should now run without mono installed. On launching the
> application I get a brief glimpse of the main form and then it closes, so I
> am close but not there yet. On launching from a terminal it appears that my
> application depends on libgdiplus.dylib - However otool does not show this
> to be the case, so I am now completely stumped as to what the next step is
> in order to get this external dependency resolved. Does anyone have any
> idea
> of how to correct this problem or a work around?
>
> Thanks for any help,
> David
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Redistributable-Mac-OSX-app-without-mono-using-mkbundle2-tp2216423p2216423.html
> Sent from the Mono - OSX mailing list archive at Nabble.com.
> _______________________________________________
> 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/20100517/486064a2/attachment.html 


More information about the Mono-osx mailing list