注册 登录
编程论坛 C++ Builder

大神从这几行错误中能分析出什么吗?

ehszt 发布于 2016-09-02 16:21, 3832 次点击
Build
  [C++ Error] Unit2.cpp(32): E2451 Undefined symbol 'RichEdit1'
  [C++ Error] Unit2.cpp(38): E2451 Undefined symbol 'RichEdit1'
  [C++ Error] Unit2.cpp(43): E2451 Undefined symbol 'RichEdit1'
  [C++ Error] Unit2.cpp(48): E2451 Undefined symbol 'RichEdit1'


[此贴子已经被作者于2016-9-2 17:02编辑过]

2 回复
#2
ehszt2016-09-02 16:26
这是Unit2.cpp中全部代码
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit2.h"
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TChildFrm *ChildFrm;
//---------------------------------------------------------------------------
__fastcall TChildFrm::TChildFrm(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TChildFrm::New1Click(TObject *Sender)
{
MDIFrm->New1Click(Sender);
}
//---------------------------------------------------------------------------
void __fastcall TChildFrm::Open1Click(TObject *Sender)
{
MDIFrm->Open1Click(Sender);
}
//---------------------------------------------------------------------------
void __fastcall TChildFrm::Save1Click(TObject *Sender)
{
if(SaveDialog1->Execute())
{
   RichEdit1->Lines->SaveToFile(SaveDialog1->FileName+".txt");
}
}
//---------------------------------------------------------------------------
void __fastcall TChildFrm::Copy1Click(TObject *Sender)
{
RichEdit1->CopyToClipboard(); //这个RichEdit1要如何定义?
}
//---------------------------------------------------------------------------
void __fastcall TChildFrm::Cut1Click(TObject *Sender)
{
RichEdit1->CutToClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TChildFrm::Paste1Click(TObject *Sender)
{
RichEdit1->PasteFromClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TChildFrm::Exit1Click(TObject *Sender)
{
MDIFrm->ActiveMDIChild->Close();
}
//---------------------------------------------------------------------------

void __fastcall TChildFrm::FormCreate(TObject *Sender)
{

}
//---------------------------------------------------------------------------


[此贴子已经被作者于2016-9-2 17:03编辑过]

#3
ehszt2016-09-02 17:09
已知
1