It appears that the event you are trying to count "PAPI_L1_DCH" is not available on i7. You can check the availability of all predefined events by running the PAPI utility papi_avail. If you replace PAPI_L1_DCH with a preset event that is available then you shouldn't get an error.

You can also try to use a native event to count the L1 data cache hits. The utility papi_native_avail lists all available native events on your machine.