[英]redefinition of a form in C++builder 10.1
I was writing a code for my app and now I can't fix the mess I made and I don't know what's exactly going on 我当时正在为我的应用程序编写代码,但现在我无法修复自己造成的混乱,而且我不知道到底发生了什么
IDE : C++builder 10.1 Berlin (FMX) IDE:C ++ builder 10.1柏林(FMX)
error1: 错误1:
[bccaarm Error] texts.cpp(12): redefinition of 'Form4'
texts.cpp(12): previous definition is here
error2: 错误2:
[bccaarm Error] texts.cpp(14): redefinition of 'TForm4'
texts.cpp(14): previous definition is here
texts.cpp: 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: 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
if you need more information just tell it to me and I will be very happy if you help me to solve it 如果您需要更多信息,请告诉我,如果您能帮助我解决该问题,我将非常高兴
The line at texts.cpp texts.cpp中的行
TForm4 *Form4;
is a redefinition of Form4
. 是
Form4
的重新定义。 The first definition is by the end of the previously included texts.h 第一个定义是之前包含的文本的结尾。
extern PACKAGE TForm4 *Form4;
It was an IDE bug I delete that form and do sth else to solve problem before I delete that I comment my texts.cpp file and compile that and after that I uncomment it and code run but after that It don't run any more with my trick so I use Another way to solve my problem . 这是一个IDE错误,我删除了该表单并做了其他操作来解决问题,然后再删除对我的texts.cpp文件进行注释并进行编译,然后取消注释并运行代码,但之后不再运行我的把戏,所以我用另一种方式来解决我的问题。 thanks for your tries but it was an stupid Radstudio bug
感谢您的尝试,但这是一个愚蠢的Radstudio错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.