There's a GCC compiler option -Wfatal-errors
to stop after the first error:
-Wfatal-errors
This option causes the compiler to abort compilation on the first error occurred rather than trying to keep going and printing further error messages
You can also use -Werror
if you want to treat warnings as errors so that you'll catch any warning that might be generated when you remove your class.