Error: "has not been declared"

Translation : put a begin (or any other suitably named) function in your class then call it in setup() in your program in the same way that Serial.begin() is called. This ensures that it will be called after the hidden init() function is called and it will be safe to diddle with the hardware.