Hi, I have a very simple .NET commandline application that I want to port to OS X.
I can run it with "mono app.exe"
However, the destination machines won't have mono installed.
So, I wanted to bundle mono inside the app.
In order to do this, I used mkbundle2:
mkbundle2 -o bundledapp.exe app.exe --deps
This works without errors, output:
OS is: Darwin
Sources: 1 Auto-dependencies: True
embedding: /Users/kclement/Projects/app/build/app.exe
embedding: /Library/Frameworks/Mono.framework/Versions/2.6.1/lib/mono/2.0/mscorlib.dll
embedding: /Library/Frameworks/Mono.framework/Versions/2.6.1/lib/mono/gac/System/2.0.0.0__b77a5c561934e089/System.dll
embedding: /Library/Frameworks/Mono.framework/Versions/2.6.1/lib/mono/gac/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
embedding: /Library/Frameworks/Mono.framework/Versions/2.6.1/lib/mono/gac/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
embedding: /Library/Frameworks/Mono.framework/Versions/2.6.1/lib/mono/gac/System.Security/2.0.0.0__b03f5f7f11d50a3a/System.Security.dll
embedding: /Library/Frameworks/Mono.framework/Versions/2.6.1/lib/mono/gac/Mono.Security/2.0.0.0__0738eb9f132ed756/Mono.Security.dll
Compiling:
as -arch i386 -o temp.o temp.s
cc -g -o bundledapp.exe -Wall temp.c `pkg-config --cflags --libs mono` temp.o
Done
I can execute this on the build machine. When I execute on a machine without mono however, it won't run.
Output:
dyld: Library not loaded: /Library/Frameworks/Mono.framework/Versions/2.6.1/lib/libmono.0.dylib
Referenced from: /Users/kristof/./bundledapp.exe
Reason: image not found
Trace/BPT trap
What am I missing? How do I include the actual mono runtime?
EDIT: I also tried adding the --static flag. That gives my app another license however, which I'm not sure I want. I then no longer complains about libmono, but about libgthread-2.0.0.dylib