Two things:
1. It doesn't solve your problem but your picture showed that the +5 wire is black and the GND wire is red. The robot inspector will probably frown on this since this is opposite to the convention.
2. Could you change your line to the following instead? If you are not moving, the X axis will read zero. But Z will give you approx. 1 (since earth has 1G). Or you should move the accelerometer board around to see if the reading changes.
Code:
std::cout<<accelerometer->GetAcceleration(Axes kAxis_Z);