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:
- Create new C# console project in MonoDevelop (contains only
Console.WriteLine ("Hello World!");
) - Change target to Release
- Build all
- In cygwin:
mkbundle -c -o host.c -oo bundle.o --deps BundleTest.exe
- Edit host.c, add
#undef _WIN32
after#endif
after#include <windows.h>
- In cygwin:
gcc -mno-cygwin -o test.exe -Wall host.c 'pkg-config --cflags --libs mono-2|dos2unix' bundle.o
- In command prompt:
test.exe
- In command prompt:
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.