[Mono-list] mkbundle output.exe does nothing

Robert Jordan robertj at gmx.net
Fri Mar 26 10:06:04 EDT 2010


On 26.03.2010 14:58, Marcovdlinden wrote:
>
> I'm trying to mkbundle my setup.exe writen in C# to enable it to run on
> windows without .net (and without mono) installed but no luck the .exe does
> nothing.
>
> I have the latest version of Mono and Cygwin anf followed various guides to
> do the build.
>
> So I tried this app:
> using System;
> namespace monotest
> {
>      class Program
>      {
>          static void Main(string[] args)
>          {
>              Console.WriteLine("Hello World");
>          }
>      }
> }
>
> I build it with VS 2008, and I also did a test with mcs (form mono
> distribution)
> mkbundle.bat run's just fine, here is its output:
> $ /cygdrive/c/progra~2/mono-2~1.3/bin/mkbundle.bat -o m2 monotest.exe --deps
> OS is: Windows
> Sources: 1 Auto-dependencies: True
>     embedding: C:\temp\monotest.exe
>     embedding: C:\PROGRA~2\MONO-2~1.3\lib\mono\2.0\mscorlib.dll
> Compiling:
> as -o temp.o temp.s
> gcc -mno-cygwin -g -o m2 -Wall temp.c `pkg-config --cflags --libs
> mono|dos2unix`  temp.o
> Done
>
> but m2.exe does not show the "hello world" text (both the VS2008 and mcs
> compiled versions showed "hello world"
>
> note: I copied libglib-2.0.0-0.dll, libgthread-2.0-0.dll and zlib1.dll in
> the 'run' dir.
>
> Anyone got a clue what I'm doing wrong?

You're not doing anything wrong. Applications are linked
for the Windows subsystem and they don't get a console.

If you want to build console apps, remove
"-mwindows" from $monoprefix/lib/pkgconfig/mono.pc

Alternatively, you may want to try this:

CC="gcc -mconsole" mkbundle ...

Robert



More information about the Mono-list mailing list