Compatibity for windows. - catch exception when compiling cpp