Too general to really tell. There's probably something in the application that gets an invalid input when it is built, causing the thing to crash...Do you read a file, open a dll, port etc, create an array...Look for things that if given the wrong input might run amok...
Try to put different parts of the application in case structures that you can control from e.g. an ini file or exclude them from the application and see if you can locate what part of the code that cause the problem. If possible upload the code here (or pictures of the most central parts) and we can have a look.