Shouldn't you just reference qgl.h or any other required files in your cube class header so that it'll know these commands?