File not found “Form2.dcu”












-2















I can't resolve this problem, anyone can help?



Unit 1 code:



unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Form2; //error here

type
TForm1 = class(TForm)


and here is Unit 2



unit Unit2;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm2 = class(TForm)
CESTITAMO: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Rezultat11: TLabel;
REZULTAT21: TLabel;
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form2: TForm2;

implementation

{$R *.dfm}

end.


yes I created Form2 made it's caption "Cestitke!" and kept name as Form2



And I would like to know how to fix it in future, thanks










share|improve this question


















  • 1





    You really should accept one of those answers. Not accepting discourages people from helping you in the future and possibly others as well.

    – Sherlock70
    Nov 16 '18 at 8:01
















-2















I can't resolve this problem, anyone can help?



Unit 1 code:



unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Form2; //error here

type
TForm1 = class(TForm)


and here is Unit 2



unit Unit2;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm2 = class(TForm)
CESTITAMO: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Rezultat11: TLabel;
REZULTAT21: TLabel;
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form2: TForm2;

implementation

{$R *.dfm}

end.


yes I created Form2 made it's caption "Cestitke!" and kept name as Form2



And I would like to know how to fix it in future, thanks










share|improve this question


















  • 1





    You really should accept one of those answers. Not accepting discourages people from helping you in the future and possibly others as well.

    – Sherlock70
    Nov 16 '18 at 8:01














-2












-2








-2








I can't resolve this problem, anyone can help?



Unit 1 code:



unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Form2; //error here

type
TForm1 = class(TForm)


and here is Unit 2



unit Unit2;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm2 = class(TForm)
CESTITAMO: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Rezultat11: TLabel;
REZULTAT21: TLabel;
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form2: TForm2;

implementation

{$R *.dfm}

end.


yes I created Form2 made it's caption "Cestitke!" and kept name as Form2



And I would like to know how to fix it in future, thanks










share|improve this question














I can't resolve this problem, anyone can help?



Unit 1 code:



unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Form2; //error here

type
TForm1 = class(TForm)


and here is Unit 2



unit Unit2;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm2 = class(TForm)
CESTITAMO: TLabel;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Rezultat11: TLabel;
REZULTAT21: TLabel;
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form2: TForm2;

implementation

{$R *.dfm}

end.


yes I created Form2 made it's caption "Cestitke!" and kept name as Form2



And I would like to know how to fix it in future, thanks







delphi delphi-7






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 15 '18 at 20:36









Edin HajdarevicEdin Hajdarevic

558




558








  • 1





    You really should accept one of those answers. Not accepting discourages people from helping you in the future and possibly others as well.

    – Sherlock70
    Nov 16 '18 at 8:01














  • 1





    You really should accept one of those answers. Not accepting discourages people from helping you in the future and possibly others as well.

    – Sherlock70
    Nov 16 '18 at 8:01








1




1





You really should accept one of those answers. Not accepting discourages people from helping you in the future and possibly others as well.

– Sherlock70
Nov 16 '18 at 8:01





You really should accept one of those answers. Not accepting discourages people from helping you in the future and possibly others as well.

– Sherlock70
Nov 16 '18 at 8:01












3 Answers
3






active

oldest

votes


















7














I think you are misunderstanding the error.



Your Uses is



uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Form2; //error here


but to access Form2, what you need to include in this list is not the name of the form, but instead the name of the unit in which it is declared, i.e. Unit2.



So, your Uses list should read:



uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Unit2;


But usually in a situation like this, it is sufficient to include Unit2 in a Uses list in the implementation section of Unit1.






share|improve this answer

































    3














    There is no unit Form2.pas. Replace Form2 with Unit2 in your uses clause.






    share|improve this answer































      2














      Delete ", Form2" from uses and add "uses Unit2;" to the implementation section. This is a working example:



      unit Unit1;

      interface

      {uses //Delphi 10.2
      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
      Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;}

      uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;


      type
      TForm1 = class(TForm)
      Button1: TButton;
      procedure Button1Click(Sender: TObject);
      private
      { Private declarations }
      public
      { Public declarations }
      end;

      var
      Form1: TForm1;

      implementation

      {$R *.dfm}

      uses Unit2;

      procedure TForm1.Button1Click(Sender: TObject);
      begin
      Form2.ShowModal; //or Form2.Show;
      end;

      end.





      share|improve this answer


























      • Welcome to SO, janeks3! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your answer with an explanation of how your code works so that future visitors to this site can understand your solution :)

        – Joel
        Nov 16 '18 at 0:42











      • Welcome, thank you for the tips @Joel

        – janeks3
        Nov 16 '18 at 1:54













      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53327534%2ffile-not-found-form2-dcu%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      7














      I think you are misunderstanding the error.



      Your Uses is



      uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, Form2; //error here


      but to access Form2, what you need to include in this list is not the name of the form, but instead the name of the unit in which it is declared, i.e. Unit2.



      So, your Uses list should read:



      uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, Unit2;


      But usually in a situation like this, it is sufficient to include Unit2 in a Uses list in the implementation section of Unit1.






      share|improve this answer






























        7














        I think you are misunderstanding the error.



        Your Uses is



        uses
        Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
        Dialogs, StdCtrls, Form2; //error here


        but to access Form2, what you need to include in this list is not the name of the form, but instead the name of the unit in which it is declared, i.e. Unit2.



        So, your Uses list should read:



        uses
        Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
        Dialogs, StdCtrls, Unit2;


        But usually in a situation like this, it is sufficient to include Unit2 in a Uses list in the implementation section of Unit1.






        share|improve this answer




























          7












          7








          7







          I think you are misunderstanding the error.



          Your Uses is



          uses
          Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
          Dialogs, StdCtrls, Form2; //error here


          but to access Form2, what you need to include in this list is not the name of the form, but instead the name of the unit in which it is declared, i.e. Unit2.



          So, your Uses list should read:



          uses
          Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
          Dialogs, StdCtrls, Unit2;


          But usually in a situation like this, it is sufficient to include Unit2 in a Uses list in the implementation section of Unit1.






          share|improve this answer















          I think you are misunderstanding the error.



          Your Uses is



          uses
          Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
          Dialogs, StdCtrls, Form2; //error here


          but to access Form2, what you need to include in this list is not the name of the form, but instead the name of the unit in which it is declared, i.e. Unit2.



          So, your Uses list should read:



          uses
          Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
          Dialogs, StdCtrls, Unit2;


          But usually in a situation like this, it is sufficient to include Unit2 in a Uses list in the implementation section of Unit1.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 15 '18 at 21:51

























          answered Nov 15 '18 at 20:47









          MartynAMartynA

          21k32257




          21k32257

























              3














              There is no unit Form2.pas. Replace Form2 with Unit2 in your uses clause.






              share|improve this answer




























                3














                There is no unit Form2.pas. Replace Form2 with Unit2 in your uses clause.






                share|improve this answer


























                  3












                  3








                  3







                  There is no unit Form2.pas. Replace Form2 with Unit2 in your uses clause.






                  share|improve this answer













                  There is no unit Form2.pas. Replace Form2 with Unit2 in your uses clause.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 15 '18 at 20:42









                  Dmitry StreblechenkoDmitry Streblechenko

                  44.2k32860




                  44.2k32860























                      2














                      Delete ", Form2" from uses and add "uses Unit2;" to the implementation section. This is a working example:



                      unit Unit1;

                      interface

                      {uses //Delphi 10.2
                      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
                      Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;}

                      uses
                      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
                      Dialogs, StdCtrls;


                      type
                      TForm1 = class(TForm)
                      Button1: TButton;
                      procedure Button1Click(Sender: TObject);
                      private
                      { Private declarations }
                      public
                      { Public declarations }
                      end;

                      var
                      Form1: TForm1;

                      implementation

                      {$R *.dfm}

                      uses Unit2;

                      procedure TForm1.Button1Click(Sender: TObject);
                      begin
                      Form2.ShowModal; //or Form2.Show;
                      end;

                      end.





                      share|improve this answer


























                      • Welcome to SO, janeks3! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your answer with an explanation of how your code works so that future visitors to this site can understand your solution :)

                        – Joel
                        Nov 16 '18 at 0:42











                      • Welcome, thank you for the tips @Joel

                        – janeks3
                        Nov 16 '18 at 1:54


















                      2














                      Delete ", Form2" from uses and add "uses Unit2;" to the implementation section. This is a working example:



                      unit Unit1;

                      interface

                      {uses //Delphi 10.2
                      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
                      Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;}

                      uses
                      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
                      Dialogs, StdCtrls;


                      type
                      TForm1 = class(TForm)
                      Button1: TButton;
                      procedure Button1Click(Sender: TObject);
                      private
                      { Private declarations }
                      public
                      { Public declarations }
                      end;

                      var
                      Form1: TForm1;

                      implementation

                      {$R *.dfm}

                      uses Unit2;

                      procedure TForm1.Button1Click(Sender: TObject);
                      begin
                      Form2.ShowModal; //or Form2.Show;
                      end;

                      end.





                      share|improve this answer


























                      • Welcome to SO, janeks3! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your answer with an explanation of how your code works so that future visitors to this site can understand your solution :)

                        – Joel
                        Nov 16 '18 at 0:42











                      • Welcome, thank you for the tips @Joel

                        – janeks3
                        Nov 16 '18 at 1:54
















                      2












                      2








                      2







                      Delete ", Form2" from uses and add "uses Unit2;" to the implementation section. This is a working example:



                      unit Unit1;

                      interface

                      {uses //Delphi 10.2
                      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
                      Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;}

                      uses
                      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
                      Dialogs, StdCtrls;


                      type
                      TForm1 = class(TForm)
                      Button1: TButton;
                      procedure Button1Click(Sender: TObject);
                      private
                      { Private declarations }
                      public
                      { Public declarations }
                      end;

                      var
                      Form1: TForm1;

                      implementation

                      {$R *.dfm}

                      uses Unit2;

                      procedure TForm1.Button1Click(Sender: TObject);
                      begin
                      Form2.ShowModal; //or Form2.Show;
                      end;

                      end.





                      share|improve this answer















                      Delete ", Form2" from uses and add "uses Unit2;" to the implementation section. This is a working example:



                      unit Unit1;

                      interface

                      {uses //Delphi 10.2
                      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
                      Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;}

                      uses
                      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
                      Dialogs, StdCtrls;


                      type
                      TForm1 = class(TForm)
                      Button1: TButton;
                      procedure Button1Click(Sender: TObject);
                      private
                      { Private declarations }
                      public
                      { Public declarations }
                      end;

                      var
                      Form1: TForm1;

                      implementation

                      {$R *.dfm}

                      uses Unit2;

                      procedure TForm1.Button1Click(Sender: TObject);
                      begin
                      Form2.ShowModal; //or Form2.Show;
                      end;

                      end.






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Nov 16 '18 at 1:36

























                      answered Nov 16 '18 at 0:39









                      janeks3janeks3

                      354




                      354













                      • Welcome to SO, janeks3! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your answer with an explanation of how your code works so that future visitors to this site can understand your solution :)

                        – Joel
                        Nov 16 '18 at 0:42











                      • Welcome, thank you for the tips @Joel

                        – janeks3
                        Nov 16 '18 at 1:54





















                      • Welcome to SO, janeks3! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your answer with an explanation of how your code works so that future visitors to this site can understand your solution :)

                        – Joel
                        Nov 16 '18 at 0:42











                      • Welcome, thank you for the tips @Joel

                        – janeks3
                        Nov 16 '18 at 1:54



















                      Welcome to SO, janeks3! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your answer with an explanation of how your code works so that future visitors to this site can understand your solution :)

                      – Joel
                      Nov 16 '18 at 0:42





                      Welcome to SO, janeks3! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your answer with an explanation of how your code works so that future visitors to this site can understand your solution :)

                      – Joel
                      Nov 16 '18 at 0:42













                      Welcome, thank you for the tips @Joel

                      – janeks3
                      Nov 16 '18 at 1:54







                      Welcome, thank you for the tips @Joel

                      – janeks3
                      Nov 16 '18 at 1:54




















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53327534%2ffile-not-found-form2-dcu%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      List item for chat from Array inside array React Native

                      Thiostrepton

                      Caerphilly