error: 'rgb8bit' does not name a type

I am currently programming my RGB LEDCube and can not solve the following error:
C:\Program Files (x86)\Arduino\libraries\LEDCube/colorgnt.h:11:3: error: 'rgb8bit' does not name a type

Code:

*
LEDCube.h
*/
#ifndef LEDCube_H
#define LEDCube_H
#include "Arduino.h"
#include <FastLED.h>
#include <Adafruit_NeoPixel.h>
#include "colorgnt.h"
class LEDCube
{
  public:
  LEDCube();
  typedef struct rgb8bit {
	uint8_t r;
	uint8_t g;
	uint8_t b;
  };
  //OTHER STUFF
};
#endif
/*
rainbowgnt.h
*/
#ifndef rainbowgnt_H
#define rainbowgnt_H
#include "LEDCube.h"

class colorgnt {
  public:
  colorgnt() {}
  rgb8bit rgb(uint8_t position);  //here does the compiler trow the error
};
#endif
/*
rainbowgnt.h
*/
#ifndef LEDCube_H
#define LEDCube_H
#include "colorgnt.h"
#include "LEDCube.h" //tried with an without
class LEDCube;
class rainbowgnt: public colorgnt {
  public:
  rainbowgnt() {}
  
  rgb8bit rgb(uint8_t position) {  //I think the compiler would throw an error as well if the error in
	rgb8bit rgb;  //line above would be solved
	rgb.r = 255;
	rgb.g = 255;
	rgb.b = 255;
	return rgb;
  }
}
#endif

Why am I getting this error and how can I solve it?

It looks to me like rgb8bit is defined inside class LEDcube
Try moving it out of the class - it's probably a scope thing.

Delta_G:
rgb8bit only exists inside the rainbowgnt class.

You could refer to it as rainbowgnt::rgb8bit.

BTW, check all your include guards. It looks like you copied from LedCube.h and have that same ifndef in two of your files. That will stop one from compiling.

I corrected the include guards, thanks.

But I do not really understand how you mean "You could refer to it as rainbowgnt::rgb8bit."

I tried:

/*
rainbowgnt.h
*/
#ifndef rainbowgnt_H
#define rainbowgnt_H
#include "LEDCube.h"

class colorgnt {
  public:
  colorgnt() {}
  LEDCube::rgb8bit rgb(uint8_t position);
};
#endif

and how you wrote

/*
rainbowgnt.h
*/
#ifndef rainbowgnt_H
#define rainbowgnt_H
#include "LEDCube.h"

class colorgnt {
  public:
  colorgnt() {}
  rainbowgnt::rgb8bit rgb(uint8_t position);
};
#endif

I wrote LEDCube::rgb8bit because rgb8bit is defined in the LEDCube class

This throws the errors: error: 'LEDCube' does not name a type

LEDCube::rgb8bit rgb(uint8_t position);

and

error: 'rainbowgnt' does not name a type

rainbowgnt::rgb8bit rgb(uint8_t position);

I need to declare types and other stuff that has to be accessible in other classes. This is possible isnt it?

I think this solved the problem but I can not test it right now because I have another issue in the code. Thanks.