[Mono-dev] Problems with mkbundle and generating a single executable file
extremedeveloper at ymail.com
Fri Jun 4 03:54:44 EDT 2010
I hope you are doing very well.
I have written a program in C# and after a lot of efforts I could make it compatible with mono and now I can run it on Linux without any problem but the problem is that I need to run my software on a cluster which is not located at my university so this might be impossible that I have access to mono on that system. What I need to do is to run my C# program on Linux but as a single executable file without calling mono simultaneously.
I found a tutorial entitled “Mkbundle: bundle Mono with your applications” available at http://forum.codecall.net/csharp-tutorials/18098-mkbundle-bundle-mono-applications.html and tried to follow all of the instructions step by step but I could not succeed. Please see below:
$ mkbundle -o Bundled1.exe H.exe --deps -z
OS is: Windows
Sources: 1 Auto-dependencies: True
compression ratio: 28.30%
compression ratio: 34.81%
compression ratio: 34.59%
compression ratio: 35.07%
compression ratio: 37.00%
compression ratio: 39.79%
compression ratio: 34.06%
compression ratio: 39.01%
compression ratio: 39.96%
compression ratio: 34.86%
compression ratio: 34.94%
compression ratio: 38.97%
compression ratio: 36.40%
compression ratio: 38.50%
compression ratio: 40.11%
compression ratio: 30.89%
as -o temp.o temp.s
gcc -mno-cygwin -g -o Bundled1.exe -Wall temp.c `pkg-config --cflags --libs mono
|dos2unix` -lz temp.o
gcc: The -mno-cygwin flag has been removed; use a mingw-targeted cross-compiler.
It seems that the error message that I got (The -mno-cygwin flag has been removed) is a famous one. I googled it and found some information as follows:
> # gcc-4 -mno-cygwin> gcc-4: The -mno-cygwin flag has been removed; use a mingw-targeted> cross-compiler.> > However, I could find no "mingw-targeted cross-compiler" for gcc-4> (though they seem to be there for gcc-3). Does one exist? Not yet, but it is coming. for now, explicitly use 'gcc-3 -mno-cygwin'or switch your default gcc to version 3.x by using/usr/bin/set-gcc-default-3.sh
By deleting gcc-4 and just using gcc-3, I got a huge number of errors and when I don’t do that I get only one error as : The -mno-cygwin flag has been removed; use a mingw-targeted cross-compilerAnd by using /usr/bin/set-gcc-default-3.sh as suggested in that forum I get "access denied" ! There are some other approaches mentioned in some other forums but non of these advice could help unfortunately.
Before trying this in windows using cygwin, I tried it in Linux as mentioned at: http://www.mono-project.com/Guide:Running_Mono_Applications but I could not succeed.
I also used Mono Tools for Visual Studio (http://go-mono.com/monotools/Package.aspx) and everything was ok until step 5. By clicking on “create package”, it starts working and shows that the package is being built (building package … etc) but after a while Visual studio generates a message saying that Visual studio has encountered a problem and must be restarted. No outcome again.
To be honest with you, until now, I have spent a huge amount of time on this issue without any outcome. I will be very very grateful to you if you do me a favour and tell me what is wrong and how I can resolve this problem.
Thank you so much in advance and sorry to interrupt you
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list