Reputation: 1311
I can successfully build a bundled exe from my MonoDevelop C# project, but when I run the bundle, it doesn't do anything; execution is terminated immediately and silently. What am I doing wrong?
I'm using Mono 2.10.5 on 64-bit Windows 7 with cygwin generally following these instructions, but with these modifications. The exact steps I follow are:
Console.WriteLine ("Hello World!");
)mkbundle -c -o host.c -oo bundle.o --deps BundleTest.exe
#undef _WIN32
after #endif
after #include <windows.h>
gcc -mno-cygwin -o test.exe -Wall host.c 'pkg-config --cflags --libs mono-2|dos2unix' bundle.o
test.exe
BundleTest.exe
In step 7, the text "Hello World!" is printed in the command prompt as expected. In step 8, nothing is printed in the command prompt; the exact same response can be elicited by typing rem and pressing enter.
EDIT: Someone else edited this question to switch steps 7 and 8, which substantively changes the description of the observed behavior. I don't know why they felt justified in doing this since they were not the ones making the observations, but it is so far removed from the time I was thinking about this problem that I don't want to just switch the back the way they were. So, note that the last paragraph before this edit probably doesn't accurately reflect my original observations any more.
Upvotes: 4
Views: 625
Reputation: 113
For building console application you should remove -mwindows flags from /lib/pkgconfig/mono-2.pc
Upvotes: 3