Debugging library - Error- expected unqualified id before '.' token I'm writing a library for my project, which interfaces sensors used and structures them in different systems.

But I'm such a noob at C++. The compiler is throwing this error:

libraries/cec-core/cec-core.cpp: In member function 'void Habitaculo::Update()':
libraries/cec-core/cec-core.cpp:15:8: error: expected unqualified-id before '.' token
_Sluz.Update();


This is the header of that class:

class Habitaculo
{
    public:
    Habitaculo(int refrate, int luzpin, int dhtpin);
    //Values from Indoor Sensors
    int temp;
    int hum;
    int luz;
    //Update Methods
    void Update();      //Updates sensors value
    void UpdateReg();   //writes to SD or enabled output method
    private:
    //Clock Managing
    long _PreviousMillis;
    unsigned long _CurrentMillis;
    int _RefreshRate;
    //Sensor instances
    class _Sluz;
    class _SDHT;
};


This are the member functions affected:

Habitaculo::Habitaculo(int refrate, int luzpin, int dhtpin){
    //Clock management
    _RefreshRate = refrate;
    _PreviousMillis = 0;
    //Systems to initialize
    LDR _Sluz(luzpin);      //analogpin
    DHT11 _SDHT(dhtpin);    //buspin
}
void Habitaculo::Update(){
    _CurrentMillis = millis();
    if (_CurrentMillis-_PreviousMillis &gt; _RefreshRate){
        _Sluz.Update();  //unqualified-id before '.' token
        _SDHT.Update();  //unqualified-id before '.' token
        temp = _SDHT.temp;  //expected primary-expression before '.'
        hum = _SDHT.hum;  //expected primary-expression before '.'
        luz = _Sluz.value;  //expected primary-expression before '.'
        _PreviousMillis = _CurrentMillis;
    }
}


The error is thrown in every step of the Update method. But I can copy that piece of code right in the Habitaculo constructor and it works well. So I assume I'm missing something basic about language syntax, because I'm really new to all this scene.

Every class involved in this (LDR, DHT11) works fine. It's when I try to put all this together into a new class - inside an unified Update method - that everything crashes.
class _Sluz;
class _SDHT;


You're forward declared two classes but I see nothing about what those classes are. You then to and use those class declarations as if they were class instances.

I think you are lacking a bit of basic syntax knowledge there. You may have meant:

Sluz _Sluz;
SDHT _SDHT;


Though not knowing what those classes are meant to be or how they are even defined I cannot know really what you think you're meaning.