Class Help, Aggregate Question

Good Afternoon Everyone, I'm new to programming and having a blast figuring everything out. I have been doing well and didn't need form help until now but I can't seem to figure out this Class stuff. Research is pointing that I haven't declared anything but I thought I did.

I get an error that states: (aggregate 'Potentiometerread Potentiometerobject' has incomplete type and cannot be defined )

My main.cpp code below

#include <Arduino.h>
#include <potentiometer.h>
#include <OLED.h>
#include <rtc.h>

int main()
{
  intdisplay();
  displaytime();
 Potentiometerread Potentiometerobject;
 
  while (true)
  {
    Potentiometerobject.getpot();
    OLED(getpot());
  }
  return (0);
}

My potentiometer.cpp code below

#include <Arduino.h>
#include <potentiometer.h>

class Potentiometerread
{
public:
  int getpot()
  {
    int pot = analogRead(0);                // Local varable pot
    int potmap = map(pot, 0, 1023, 0, 100); // map values 0-100
    delay(250);
    return (potmap);
  } // Close Void getpot
}; // Close Class Potentiometer

my poteniometer.h code below

class Potentiometerread;
int getpot();

aggregate 'Potentiometerread Potentiometerobject' has incomplete type and cannot be defined

your .h files needs to declare the function inside your class

class Potentiometerread {
public:
  int getpot();
}

and then your .cpp file needs to define what your getpot() function does

#include <Arduino.h>
#include <potentiometer.h>

int Potentiometerread::getpot() {
    int pot = analogRead(0);                // Local varable pot
    int potmap = map(pot, 0, 1023, 0, 100); // map values 0-100
    delay(250);
    return (potmap);
}

blh64:
your .h files needs to declare the function inside your class

Good Afternoon Blh64,

Thank you so much, the code for that issue is now fixed. I will study the change. A new error showed up but let me try to figure that out before I post anything on this topic.

Thank you !

ok so now I have a different problem.

('getpot' was not declared in this scope ) in mian.cpp OLED(getpot()); is where the error is

Code in main.cpp ... I tired adding int pot and int potmap to the public list, but that didn't seam to fix it.

#include <Arduino.h>
#include <potentiometer.h>
#include <OLED.h>
#include <rtc.h>

//******************************************Main******************************/
int main()
{
  intdisplay();
  displaytime();
  Potentiometerread Potentiometerobject;
  while (true)
  {
    
    Potentiometerobject.getpot();
    OLED(getpot());
  }
  return (0);
}
//******************************************Main******************************

Code for potentiometer.h

class Potentiometerread {
public:
 int getpot();

};// Close Class Potentiometerread

code for potentiometer.cpp

#include <Arduino.h>
#include <potentiometer.h>


  int Potentiometerread::getpot()
  {
    int pot = analogRead(0);                // Local varable pot on pin A0
    int potmap = map(pot, 0, 1023, 0, 100); // map values 0-100
    delay(250);
    return (potmap);
  } // Close int getpot

Nvm I fixed it, gezz it was silly, I just need to add

OLED(Potentiometerobject.getpot());