Switch to c++ compile mode

Also include "use try/catch instead of SETJMP/LONGJMP" by wodan.