我目前正在尝试让我的 C# 程序在 Linux 上运行。在我的 Linux 机器上使用 mono,程序运行良好。所以我使用了 mkbundle,它全部编译正确。但是当我尝试在任何其他 Linux 机器上运行捆绑的程序时,我得到了这个错误:
Unhandled Exception: System.TypeInitializationException: An exception was thrown by the
type initializer for System.Windows.Forms.XplatUI --->
System.TypeInitializationException: An exception was thrown by the type initializer for
System.Drawing.GDIPlus ---> System.DllNotFoundException: libgdiplus.so.0
这是我使用的 mkbundle 命令:
mkbundle --static program.exe --deps -o a.out
我也尝试使用 mkbundle2 没有运气。
我想也许有一种方法可以专门包含带有 mkbundle 的库(比如告诉在哪里可以找到 libgdiplus)。当我使用 mkbundle 时它应该被链接,但我想这不是因为当我在任何其他 Linux 机器上运行我的程序(不是运行单声道)时,我得到了这个错误。
两台机器都运行 Ubuntu 10.10 AMD64。