MrProgrammer
Programmer
Hi everybody!!
I'm using Borland C++ Builder 5.0 and I have a problem!
In my project, there is a form named Form1. Its source file is Unit1.CPP and the header file is Unit1.H . In Unit1.CPP, I declared a control array like "TImage *Squares[8][8];".
Then in Form1's show event, I wrote some code like below:
void __fastcall TForm1::FormShow(TObject *Sender)
{ int i,j;
for (j=0;j<8;j++)
for (j=0;j<8;j++)
{ Squares[j] = new TImage(this);
Squares[j]->Parent = Form1;
Squares[j]->Width = 40;
Squares[j]->Height = 40;
Squares[j]->OnClick = Square_Click;
}
Square_Click is a function that I declared in Unit1.CPP. I put its prototype into Form1's class definition in the Unit1.H as below.
class TForm1 : public TForm
{
__published: // IDE-managed Components
void __fastcall FormShow(TObject *Sender);
void __fastcall Square_Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
But when I compile, I'm having an error like "[Linker Error] Unresolved external '__fastcall TForm1::Square_Click(System::TObject *)' referenced from Unit1.OBJ"
Can you help me please???
I'm using Borland C++ Builder 5.0 and I have a problem!
In my project, there is a form named Form1. Its source file is Unit1.CPP and the header file is Unit1.H . In Unit1.CPP, I declared a control array like "TImage *Squares[8][8];".
Then in Form1's show event, I wrote some code like below:
void __fastcall TForm1::FormShow(TObject *Sender)
{ int i,j;
for (j=0;j<8;j++)
for (j=0;j<8;j++)
{ Squares[j] = new TImage(this);
Squares[j]->Parent = Form1;
Squares[j]->Width = 40;
Squares[j]->Height = 40;
Squares[j]->OnClick = Square_Click;
}
Square_Click is a function that I declared in Unit1.CPP. I put its prototype into Form1's class definition in the Unit1.H as below.
class TForm1 : public TForm
{
__published: // IDE-managed Components
void __fastcall FormShow(TObject *Sender);
void __fastcall Square_Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
But when I compile, I'm having an error like "[Linker Error] Unresolved external '__fastcall TForm1::Square_Click(System::TObject *)' referenced from Unit1.OBJ"
Can you help me please???