代码之家  ›  专栏  ›  技术社区  ›  AARMN

C++builder 10.1中表单的重新定义

  •  0
  • AARMN  · 技术社区  · 8 年前

    IDE:C++builder 10.1柏林(FMX)

    错误1:

    [bccaarm Error] texts.cpp(12): redefinition of 'Form4'
    texts.cpp(12): previous definition is here
    

    [bccaarm Error] texts.cpp(14): redefinition of 'TForm4'
    texts.cpp(14):  previous definition is here
    

    文本。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)
    {
    }
    //---------------------------------------------------------------------------
    

    文本。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
    

    2 回复  |  直到 8 年前
        1
  •  0
  •   Ripi2 user10587824    8 年前

    文本处的行。清洁石油产品

    TForm4 *Form4;
    

    Form4 . 第一个定义是在前面包含的文本末尾。h

    extern PACKAGE TForm4 *Form4;
    
        2
  •  0
  •   AARMN    8 年前

    这是一个IDE错误,我删除了那个表单并做了其他事情来解决这个问题 在我删除之前,我会评论我的文本。cpp文件并编译,然后我取消注释并运行代码,但在那之后,它不再使用我的技巧运行,所以我使用另一种方法来解决我的问题。 谢谢你的尝试,但这是一个愚蠢的Radstudio错误