File not found “Form2.dcu”
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
add a comment |
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
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
add a comment |
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
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
delphi delphi-7
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
add a comment |
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
add a comment |
3 Answers
3
active
oldest
votes
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.
add a comment |
There is no unit Form2.pas. Replace Form2 with Unit2 in your uses clause.
add a comment |
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.
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
edited Nov 15 '18 at 21:51
answered Nov 15 '18 at 20:47
MartynAMartynA
21k32257
21k32257
add a comment |
add a comment |
There is no unit Form2.pas. Replace Form2 with Unit2 in your uses clause.
add a comment |
There is no unit Form2.pas. Replace Form2 with Unit2 in your uses clause.
add a comment |
There is no unit Form2.pas. Replace Form2 with Unit2 in your uses clause.
There is no unit Form2.pas. Replace Form2 with Unit2 in your uses clause.
answered Nov 15 '18 at 20:42
Dmitry StreblechenkoDmitry Streblechenko
44.2k32860
44.2k32860
add a comment |
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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