[Mono-dev] mkbundle --cross

David Curylo curylod at asme.org
Tue Jun 27 12:06:41 UTC 2017


You need to also add System.dll to the command line, and you’ll find that you have to add all of those other libraries, as well as possibly a few other that are under /usr/lib/mono/4.5/Facades if you use things like from those libraries like TaskExtensions from System.Threading.Tasks.dll.  According to the docs, --deps is supposed to discover those, but I’ve never been able to get it to find them even though things are directly referenced (not loading by reflection or anything).

I think you also need the --static flag to embed the mono runtime libraries.

> On Jun 27, 2017, at 5:27 AM, dmaxime via Mono-devel-list <mono-devel-list at lists.dot.net> wrote:
> 
> Hello everybody,
> I would like to build a 'all in one' OSX program from linux (ubuntu).
> 
> 
> This is the linux version I'm using:
> Linux  4.4.0-81-generic #104-Ubuntu SMP Wed Jun 14 08:17:06 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
> 
> 
> This and the Mono version installed:
> Mono JIT compiler version 5.0.1.1 (2017-02/5077205 Thu May 25 09:16:53 UTC 2017)
> Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com <http://www.mono-project.com/>
>     TLS:           __thread
>     SIGSEGV:       altstack
>     Notifications: epoll
>     Architecture:  amd64
>     Disabled:      none
>     Misc:          softdebug 
>     LLVM:          supported, not enabled.
>     GC:            sgen (concurrent by default)
> 
> These are the necessary frameworks to run my program:
>     Microsoft.CSharp.dll
>     System.Configuration.dll
>     System.Data.DataSetExtensions.dll
>     System.Data.dll
>     System.Deployment.dll
>     System.dll
>     System.Drawing.dll
>     System.IO.Compression.dll
>     System.IO.Compression.FileSystem.dll
>     System.Net.Http.dll
>     System.Runtime.Serialization.dll
>     System.Web.dll
>     System.Web.Extensions.dll
>     System.Windows.Forms.dll
>     System.Xml.dll
>     System.Xml.Linq.dll
> 
> I took the following environments using the command "mkbundle --fetch-target":
> mono-5.0.1-osx-10.7-i386.zip
> 
> I ran the build, using mkbundle, with the following command:
> $ mkbundle --deps --cross mono-5.0.1-osx-10.7-i386.zip -o launcher-mac CHElauncher.exe
> 
> And this is the resulting output:
> From: ~/.mono/targets/mono-5.0.1-osx-10.7-i386.zip
> Using runtime: ~/.mono/targets/mono-5.0.1-osx-10.7-i386.zip/bin/mono
>     Assembly: ~/mac/CHElauncher.exe
>     Assembly: ~/.mono/targets/mono-5.0.1-osx-10.7-i386.zip/lib/mono/4.5/I18N.West.dll
>     Assembly: ~/.mono/targets/mono-5.0.1-osx-10.7-i386.zip/lib/mono/4.5/I18N.dll
> Generated launcher-mac
> 
> Note that my program runs fine in windows, linux and mac environments but when I move the resulting file from the build to the mac pc, where no mono environment is installed, and run it, I get the following error:
> $ ./CHElauncher.exe
> The assembly mscorlib.dll was not found or could not be loaded.
> It should have been installed in the `/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/4.5/mscorlib.dll' directory.
> 
> 
> I also tried to add mscorlib.dll to the command line mkbundle and I received this error:
> 
> Unhandled Exception:
> System.IO.FileNotFoundException: Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
> File name: 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
> [ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
> File name: 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
> 
> Could you explain to me what I'm wrong? 
> Thanks in advance for your attention.
> 
> 
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.dot.net
> http://lists.dot.net/mailman/listinfo/mono-devel-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-devel-list/attachments/20170627/9313c6f8/attachment.html>


More information about the Mono-devel-list mailing list