[Mono-dev] Problems with mkbundle and generating a single executable file

Extreme Developer extremedeveloper at ymail.com
Fri Jun 4 03:54:44 EDT 2010


Dear all, 
Hello! 
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 
   embedding: E:\cygwin\home\BEHROOZ\Hyper_Heuristic.exe 
   compression ratio: 28.30% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\System.Windows.Forms.dll 
   compression ratio: 34.81% 
   embedding: E:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\mscorlib.dll 
   compression ratio: 34.59% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\System.Drawing.dll 
   compression ratio: 35.07% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\System.dll 
   compression ratio: 37.00% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\System.Configuration.dll 
   compression ratio: 39.79% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\System.Xml.dll 
   compression ratio: 34.06% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\System.Security.dll 
   compression ratio: 39.01% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\Mono.Security.dll 
   compression ratio: 39.96% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\Mono.WebBrowser.dll 
   compression ratio: 34.86% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\System.Data.dll 
   compression ratio: 34.94% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\Mono.Data.Tds.dll 
   compression ratio: 38.97% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\System.Transactions.dll 
   compression ratio: 36.40% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\System.EnterpriseServices.dll 
   compression ratio: 38.50% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\Mono.Posix.dll 
   compression ratio: 40.11% 
   embedding: e:\PROGRA~1\MONO-2~1.4\lib\mono\2.0\Accessibility.dll 
   compression ratio: 30.89% 
Compiling: 
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. 
  
[Fail] 
  
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 
  
Best regards, 
Alex 


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100604/fe25fd6a/attachment-0001.html 


More information about the Mono-devel-list mailing list