Getting BPM and Beats

I'm trying to understand but I'm still a newbie with C++.

I tried as you said but I got this error on the first line

Field type 'juce::AudioPlayHead' is an abstract class.

 

Could you explain step by step what should I do? Thanks.