It should run on your computer, so I'm assuming this is what happens on a different computer that you've deployed it to. If that happens, the most likely reason is they don't have the MCR corresponding to the version you compiled it with. To get the error message and not have the window vanich immediately, get a console window (DOS prompt) and type in the name of your program. Any error message should appear and remain. The window will not close because you opened it separately. Make sure you've changed directory so that you're in the directory with your executable.
To make it easy, if you have Windows, you can add an entry to the context menu so that you can browse there with FIle Explorer and then right click and select "Run DOS Prompt Here". Take these lines
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\Shell\DosPrompt]
@="Run MS-DOS Prompt here"
[HKEY_CLASSES_ROOT\Directory\Shell\DosPrompt\Command]
@="Cmd /k CD \"%L\" "
and open a text file and copy them into it, then save it (anywhere) as "Dos Prompt Here.reg". Then double click that file and tell it to make the change to the registry. Then you can just browse to the folder and right click on the yellow folder icon to open a console window there. It's much easier than using CD a bunch of times to get to the folder you need to be in.
Anyway, what do you see in the console window when you try to run your program?
To get the correct MCR on the computer where your executable is installed on, download it from here: