Debugging doesn't mean building a debug version of your program. Debugging means doing things like setting breakpoints so that when you build and run the debug version, you can see what's going on at specific points in the code (and which ones it even gets to), step through the code one line at a time, check the call stack and the values of all your variables at each step, and so on.
Since the code is short, what you probably want to do to debug this problem is set a breakpoint on the first line of main, run a debug build, then step through the program one line at a time from there until you see what line is causing the problem.