Question

I am migrating my Delphi 5 application to Delphi XE3. I am totally new to XE3.

While compiling application I am getting error 'Undeclared Identifier Interace_Info'.

Code is like below:

abc.inc:

Interace_Info = packed record
iflag: ulong;
end;

.

Unit unit2
type
ulong: DWORD;
{$include abc.inc}
end.

.

Unit unit1
uses unit2;
type
Tlocal= array[0..10] of Interace_Info;

Where Interace_Info is declared in 'abc.inc' file.

I am not able to open any file which is mentioned in uses section by pressing Ctrl+left mouse button. I am getting error "Unable to locate file 'winapi.unit2.pas' ".

What is the solution to this?

Thanks

Was it helpful?

Solution

As commented, your code can't be real code.

I'm posting this, which I compiled right now with Delphi XE3 without any problem.

file: abc.inc

type
  Interace_Info = packed record
    iflag: ulong;
  end;

file: Unit2.pas

unit Unit2;

interface
uses winapi.Windows;

{$include abc.inc}

implementation

end.

file: Unit1.pas

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,  Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

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

var
  Form1: TForm1;

implementation
uses Unit2;

type
  TLocal = array[0..10] of Interace_Info;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  ALocal: TLocal;
begin
  ALocal[0].iflag := 0;
  ShowMessage(IntToStr(ALocal[0].iflag));
end;

end.

It compiles and run without any problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top