You need to make sure the old process has exited before you try and compile a new version.

Use task manager or process explorer to watch when your executable gets run, and make sure it disappears when you pass the "press any key to continue".