I just get standard "application has crashed and was terminated" window
I think that indicates that the program has compiled successfully - and that you're getting a segfault (ie runtime error) before any other output has been produced.
Some print "Got to here\n"; statements sprinkled throughout should help determine where the error is occurring.