mkbundle and GTK#

我的未来我决定 提交于 2019-12-01 01:48:14

I found a shell script which does all this and modified it to the latest versions, as of May 2013 you can just use the script as follows:

https://gist.github.com/tebjan/5581296

1.) Install cygwin and make sure you select the following packages: - gcc-mingw - pkg-config - mingw-zlib1 - mingw-zlib-devel

2.) Install the Mono release package: "Mono for Windows, Gtk#, and XSP"

3.) Download the script place it besides your Application and modify it to fit your environment (read the comments in the file carefully).

4.) Open cygwin and navigate to the output folder of your application where the ececutable and the scipt lies, e.g. YourProject/bin/Release

5.) Execute the script with the command: ./mkbundle_cygwin.sh

Troubleshooting: If your bundled executable does not work make sure the original .NET application works on mono. You can test that by calling mono.exe and pass your .NET app to it or by installing XamarinStudio and running your project from there (make you set mono as runtime).

OK I don't know if this is a real solution, but I just copied the assemblies from C:\GtkSharp\2.12\lib\gtk-sharp-2.0 to C:\Mono-2.10.5\lib\mono\4.0 and now it seems to bundle ok using the following steps:

mkbundle -c -o host.c -oo bundle.o --deps app.exe

nano host.c

change the following from:

#ifdef _WIN32
#include <windows.h>
#endif`

to

#ifdef _WIN32
#include <windows.h>
#endif
#undef _WIN32

And finally:

gcc -mno-cygwin -o bundled.exe -Wall host.c `pkg-config --cflags --libs mono-2|dos2unix` bundle.o

That worked for me. Though I also for some things have needed to copy machine.config from C:\Mono-2.10.5\etc\mono\4.0 to the directory where my application is, and pass --machine-config machine.config to mkbundle.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!