'identifier' used on polymorphic type 'type' with /GR-; unpredictable behavior may result
You did not enable run-time type information and tried to use a feature that requires run-time type information support. Recompile with the /GR switch.
For more information, see the Enable Run-Time Type Information (/GR) compiler option.