单声道 mkbundle 窗口
我在 cygwin 上使用 mono mkbundle 来编译 dot net 应用程序,并且工作正常。我使用了这里的说明 c# cywgwin mono mkbundle windows 7 - 不能编译文件
除非以下文件(从 mono/bin 复制)文件夹与应用程序位于同一文件夹中,否则完成的应用程序将不会运行:mono.dll、libglib-2.0-0.dll、libgthread-2.0- 0.dll,zlib.dll
这一切看起来都不错 - 但是如果我运行命令(来自 cygwin)
$ objdump -p mycompiledapp.exe | grep“DLL 名称”
(其中“mycompiledapp.exe”是应用程序的名称)
文件 mono.dll、libglib-2.0-0.dll、libgthread-2.0-0.dll 已嵌入到我的应用程序中。
当这些文件已经嵌入到我的应用程序中时,为什么它们需要与我的应用程序位于同一文件夹中才能正常运行?
我在编译时是否做错了什么?
有没有办法:
a) 不要将这些程序集嵌入到我的应用程序中(以便它们可以随应用程序一起分发)
b) 编译我的应用程序,以便它知道这些程序集嵌入在应用程序中,并使用它们? (并且不必使用应用程序分发这些文件)
当它们已经嵌入到我的应用程序中时,使用我的应用程序分发这些文件似乎很痛苦! (特别是考虑到这些程序集的大小 - 一个 50k 点网络应用程序作为编译后的单一应用程序变成了大约 5megs,并且需要与额外的 4megs 程序集一起分发才能运行......e)
感谢您的任何信息,
铁匠铺
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在运行mkbundle时添加--static标志。请注意,这将嵌入 LGPL 的 Mono 库 (mono.dll)。至于 libglib 和 libgthread,您应该找到它们的静态版本并在链接时使用它。请注意,在程序中嵌入 LGPL 库将会具有其他
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.