Cannot compile APMrover2 on Raspberry - unrecognized command line option '-std=gnu++11'

The last post in this thread should solve your problem: