Initialization of reference member of base class in derived class?

I have the following situation/problem:

class utilities {
public:
utilities() {}
	//lots of Members
};

class animation {
public:
	animation() {}
	virtual void render() = 0; //abstract class
	//other members
protected:
	utilities &utils;
};

class randomAnimation : public animation {
public:
	C(int wait, RGB24B color) {}

	virtual void render() {
		utils.sth(); //needs to be accessed in derived classes of animation, How can it be initialized?
	}
};

I have a class 'utilities' that contains member that need to be called from animations.
At the beginning of my programm one instance of the class 'utilities' is defined.
Animations are derived classse of the class 'animation'.

To achieve that derived classes of the 'animation' class can access the instance of the class 'utilities' did I use a pointer instead of a reference which got defined with a member function of the class 'animation'.

I know that the reference must be initialized in a constructor of a class if it is its member. This would be easy if I would not need inheritance. Is it possible to do that and if how?

Every class should have a constructor, even if the constructor does nothing. randomAnimation does not, so the compiler generates one for you that does who knows what. Don't let that happen.

How does the base class, animation, learn of the existence of the utilities instance?

It would be a lot simpler if all the methods in the utilities class were static.

PaulS:
Every class should have a constructor, even if the constructor does nothing. randomAnimation does not, so the compiler generates one for you that does who knows what. Don't let that happen.

How does the base class, animation, learn of the existence of the utilities instance?

It would be a lot simpler if all the methods in the utilities class were static.

I made a mistake writing this simplified example:

the line 'C(int wait, RGB24B color) {}' should be 'randomAnimation(int wait, RGB24B color) {}'

Exactly that is my question, I would change the constructor of the base class 'animation' to:

animation(utilities &leds) : utils(leds){} //leds is the utilities instance

to initialize the reference but because this is the base class constructor would it not be called or am I wrong?

Making all methods/members of the class 'utilities' static is possible but how would this help? There will be only one instance of this class.

class utilities {
public:
utilities() {}
  //lots of Members
  void sth() { }
};

class animation {
public:
  animation(utilities &u) : utils(u) {}
  virtual void render() = 0; //abstract class
  //other members
protected:
  utilities &utils;
};

class randomAnimation : public animation {
public:
  randomAnimation(/*int wait, RGB24B color,*/ utilities &u) : animation(u) {}

  virtual void render() {
    utils.sth();
  }
};

arduarn:

class utilities {

public:
utilities() {}
 //lots of Members
 void sth() { }
};

class animation {
public:
 animation(utilities &u) : utils(u) {}
 virtual void render() = 0; //abstract class
 //other members
protected:
 utilities &utils;
};

class randomAnimation : public animation {
public:
 randomAnimation(/int wait, RGB24B color,/ utilities &u) : animation(u) {}

virtual void render() {
   utils.sth();
 }
};

I do not completly understand what this code would do:

If I would create a instance of randomAnimation would I have to do this:

randomAnimation ani(myInstanceofutilities)

?

I would test if it works but the code is for a 777 or 121212 RGB LEDCube and I am in holiday right now and do not have a cube with me.

hallolo:
If I would create a instance of randomAnimation would I have to do this:

randomAnimation ani(myInstanceofutilities)

?

yes.

arduarn:
yes.

Thank you, you always have very good answers