unresolved external

0

Witam,
mam taki problem: w pewnej klasie tworze sobie zmienną statyczną do której się chce później odwołać w funkcjach tej klasy. Niestety ciągle mi wyskakuje błąd gdy tylko próbuje się odwołać do tej zmiennej

[Linker error] Unresolved external 'klasa::zmienna' referenced from "sciezka"

Pisze w Borland C++ Builder 6

0

Pokaż tę klasę i zmienną.
Kompilator z jakiegoś powodu traktuje ją jako deklarację external.

0

plik h

class Pole 
{
private:
        static int Mapa_Tla[12][12];

        void Pole::Przejscia(TImage* Owner, int ktory_x, int ktory_y, int tlo);
}

plik cpp

void Pole::Przejscia(TImage* Owner, int ktory_x, int ktory_y, int tlo)
{      
        if (Mapa_Tla[ktory_x+1][ktory_y]!=Mapa_Tla[ktory_x][ktory_y])
        {       if (Mapa_Tla[ktory_x+1][ktory_y]==0)
                {       for(int x=1; x<10; x++)
                        {       for( int y=0; y<50/x; y++)
                                {       Pole->Canvas->Pixels[Pole->Width-x][random(Pole->Width)]=clGreen;
                }       }       }
                else if (Mapa_Tla[ktory_x+1][ktory_y]==1)
                {       for(int x=1; x<10; x++)
                        {       for( int y=0; y<50/x; y++)
                                {       Pole->Canvas->Pixels[Pole->Width-x][random(Pole->Width)]=clYellow;
        }       }       }       }

        if (Mapa_Tla[ktory_x-1][ktory_y]!=Mapa_Tla[ktory_x][ktory_y])
        {       if (Mapa_Tla[ktory_x-1][ktory_y]==0)
                {       for(int x=1; x<10; x++)
                        {       for( int y=0; y<50/x; y++)
                                {       Pole->Canvas->Pixels[x-1][random(Pole->Width)]=clGreen;
                }       }       }
                else if (Mapa_Tla[ktory_x-1][ktory_y]==1)
                {       for(int x=1; x<10; x++)
                        {       for( int y=0; y<50/x; y++)
                                {       Pole->Canvas->Pixels[x-1][random(Pole->Width)]=clYellow;
        }       }       }       }

        if (Mapa_Tla[ktory_x][ktory_y-1]!=Mapa_Tla[ktory_x][ktory_y])
        {       if (Mapa_Tla[ktory_x][ktory_y-1]==0)
                {       for(int x=1; x<10; x++)
                        {       for( int y=0; y<50/x; y++)
                                {       Pole->Canvas->Pixels[random(Pole->Width)][x-1]=clGreen;
                }       }       }
                else if (Mapa_Tla[ktory_x][ktory_y-1]==1)
                {       for(int x=1; x<10; x++)
                        {       for( int y=0; y<50/x; y++)
                                {       Pole->Canvas->Pixels[random(Pole->Width)][x-1]=clYellow;
        }       }       }       }

        if (Mapa_Tla[ktory_x][ktory_y+1]!=Mapa_Tla[ktory_x][ktory_y])
        {       if (Mapa_Tla[ktory_x][ktory_y+1]==0)
                {       for(int x=1; x<10; x++)
                        {       for( int y=0; y<50/x; y++)
                                {       Pole->Canvas->Pixels[random(Pole->Width)][Pole->Height-x]=clGreen;
                }       }       }
                else if (Mapa_Tla[ktory_x][ktory_y+1]==1)
                {       for(int x=1; x<10; x++)
                        {       for( int y=0; y<50/x; y++)
                                {       Pole->Canvas->Pixels[random(Pole->Width)][Pole->Height-x]=clYellow;
}        }       }       }       }
0

A czy gdziekolwiek masz DEFINICJĘ tej tablicy? Bo w klasie to jest tylko jej deklaracja. Musisz mieć gdzieś

int Pole::Mapa_Tla[12][12];
0

Rzeczywiście teraz śmiga aż miło:) thx

1 użytkowników online, w tym zalogowanych: 0, gości: 1