在 C++builder 10.1 中重新定义表单
redefinition of a form in C++builder 10.1
我正在为我的应用程序编写代码,但现在我无法修复我造成的混乱,我不知道到底发生了什么
IDE : C++builder 10.1 柏林 (FMX)
错误 1:
[bccaarm Error] texts.cpp(12): redefinition of 'Form4'
texts.cpp(12): previous definition is here
错误2:
[bccaarm Error] texts.cpp(14): redefinition of 'TForm4'
texts.cpp(14): previous definition is here
texts.cpp:
//---------------------------------------------------------------------------
#include <fmx.h>
#pragma hdrstop
#include "texts.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm4 *Form4;
//---------------------------------------------------------------------------
__fastcall TForm4::TForm4(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
texts.h:
//---------------------------------------------------------------------------
#ifndef textsH
#define textsH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <FMX.Controls.hpp>
#include <FMX.Forms.hpp>
#include <FMX.Controls.Presentation.hpp>
#include <FMX.StdCtrls.hpp>
#include <FMX.Types.hpp>
//---------------------------------------------------------------------------
class TForm4 : public TForm
{
__published: // IDE-managed Components
TLabel *erremptb;
TLabel *errnofloat;
TLabel *errjustpos;
TLabel *errnoneg;
TLabel *errinp2;
TLabel *errinp1;
private: // User declarations
public: // User declarations
__fastcall TForm4(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm4 *Form4;
//---------------------------------------------------------------------------
#endif
如果您需要更多信息,请告诉我,如果您能帮助我解决问题,我将非常高兴
texts.cpp
处的行
TForm4 *Form4;
是对Form4
的重新定义。第一个定义是在前面包含的 texts.h
的末尾
extern PACKAGE TForm4 *Form4;
这是一个 IDE 错误 我删除了那个表格并做了其他事情来解决问题
在我删除它之前,我注释了我的 texts.cpp 文件并编译它,然后我取消注释它并编码 运行 但在那之后它不再 运行 我的技巧所以我使用另一个解决我的问题的方法。
感谢您的尝试,但这是一个愚蠢的 Radstudio 错误
我正在为我的应用程序编写代码,但现在我无法修复我造成的混乱,我不知道到底发生了什么
IDE : C++builder 10.1 柏林 (FMX)
错误 1:
[bccaarm Error] texts.cpp(12): redefinition of 'Form4'
texts.cpp(12): previous definition is here
错误2:
[bccaarm Error] texts.cpp(14): redefinition of 'TForm4'
texts.cpp(14): previous definition is here
texts.cpp:
//---------------------------------------------------------------------------
#include <fmx.h>
#pragma hdrstop
#include "texts.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm4 *Form4;
//---------------------------------------------------------------------------
__fastcall TForm4::TForm4(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
texts.h:
//---------------------------------------------------------------------------
#ifndef textsH
#define textsH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <FMX.Controls.hpp>
#include <FMX.Forms.hpp>
#include <FMX.Controls.Presentation.hpp>
#include <FMX.StdCtrls.hpp>
#include <FMX.Types.hpp>
//---------------------------------------------------------------------------
class TForm4 : public TForm
{
__published: // IDE-managed Components
TLabel *erremptb;
TLabel *errnofloat;
TLabel *errjustpos;
TLabel *errnoneg;
TLabel *errinp2;
TLabel *errinp1;
private: // User declarations
public: // User declarations
__fastcall TForm4(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm4 *Form4;
//---------------------------------------------------------------------------
#endif
如果您需要更多信息,请告诉我,如果您能帮助我解决问题,我将非常高兴
texts.cpp
处的行TForm4 *Form4;
是对Form4
的重新定义。第一个定义是在前面包含的 texts.h
extern PACKAGE TForm4 *Form4;
这是一个 IDE 错误 我删除了那个表格并做了其他事情来解决问题 在我删除它之前,我注释了我的 texts.cpp 文件并编译它,然后我取消注释它并编码 运行 但在那之后它不再 运行 我的技巧所以我使用另一个解决我的问题的方法。 感谢您的尝试,但这是一个愚蠢的 Radstudio 错误