I have this function:

Code:
void Estacao::mostraInformacaoEstacao()
{
    cout << "++ Estacao " << nome << endl;
    cout << "   tem ligacoes para:" << endl;

    //percorre as ligações existentes
    for (int i = 0; i < ligacoes.size(); i++)
    {
        //mostra a estação para a qual tem ligação
        cout << "     - " << ligacoes[i] << endl;

        for (int j = 0; j < linhas.size(); j++)
        {
            if (linhas[j].estacoes[0] == nome && linhas[j].estacoes[1] == ligacoes[i])
            {
                cout << "(" << linhas.distancia << ", " << linhas.tipo << ")";
            }
        }
    }
}
that's defined inside estacao.cpp, that includes Estacao.h and Sistema.h, where the class Estacao is defined.

My problem is that linhas (in the second "for" loop) is not defined inside the class Estacao, but in the class Sistema (defined in Sistema.h).

I get the error that linhas is undeclared.

It's not a problem of includes because I included every single header file used.

Sorry if this has been posted before but i'm in a hurry.

Thanks in advance.