Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
390 views
in Technique[技术] by (71.8m points)

cygwin - mono mkbundle windows

I've used mono mkbundle on cygwin, to compile a dot net app, and it works fine. I used the instructions from here c# cywgwin mono mkbundle windows 7 - cannot compile file

The finished app will not run unless the following files (copied from the mono/bin) folder are in the same folder as the app: mono.dll, libglib-2.0-0.dll, libgthread-2.0-0.dll, zlib.dll

This all seems ok - however if I run the command (from cygwin)

$ objdump -p mycompiledapp.exe | grep "DLL Name"
(where "mycompiledapp.exe" is the name of the app)

The files mono.dll, libglib-2.0-0.dll, libgthread-2.0-0.dll are already embedded in my app.

Why do these files need to be in the same folder as my app for it to function, when they are already embedded within my app?

Have I done something incorrect when compiling?

Is there any way to either:
a) Not embed these assemblies in my app (so they can be distributed with it)
b) Compile my app so it knows these assemblies are embedded in the app, and use those? (and not have to distribute these files with the app)

It just seems a pain to distribute these files with my app, when they are already embedded within it! (Especially considering the size of these assemblies - a 50k dot net app becomes around 5megs as a compiled mono-app, and this needs to be distributed with an additional 4 megs of assemblies for it to function...e)

Thank you for any info,

Smithy

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can add the --static flag when running mkbundle. Note that this will embed the Mono library (mono.dll) which is LGPL. As for libglib and libgthread, you should find a static version of them and use that when linking. Note that embedding LGPL libraries in your program will have other implications.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...