Forum > LCL

LCL Unit Interface Fault?

(1/2) > >>

evowinds:
Hello Guys;
I installed Lazarus to my Ubuntu 10.4. Then when I try to compile an application (a simple hello world for testing) I get these warnings:
"This project does not use the LCL Unit Interfaces but it seems it needs it.
You will get strange linker errors if you use the LCL forms without interfaces
Add unit interfaces-Ignore-Always Ignore-Cancel"

How can I fix this problem? I try to add unit interface, compile the LCL but they do not help me so far. Please show me a way to continue to work with Lazarus.  

--- Code: ---unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs;

type

  { TForm1 }

  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
  ShowMessage('Hi!');
end;

initialization
  {$I unit1.lrs}

end.     
--- End code ---


--- Code: ---program Project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms, Unit1, LResources
  { you can add units after this };

{$IFDEF WINDOWS}{$R project1.rc}{$ENDIF}

begin
  {$I project1.lrs}
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.   
--- End code ---

Leledumbo:
Nothing is wrong in your code. But could you please check Project Inspector? Make sure it depends on LCL.

evowinds:
Yes it has a dependency on LCL. What for next?

JuhaManninen:

--- Quote from: evowinds on April 09, 2010, 08:47:29 am ---Hello Guys;
I installed Lazarus to my Ubuntu 10.4. Then when I try to compile an application (a simple hello world for testing) I get these warnings:
"This project does not use the LCL Unit Interfaces but it seems it needs it.
You will get strange linker errors if you use the LCL forms without interfaces
Add unit interfaces-Ignore-Always Ignore-Cancel"

--- End quote ---

Add "Interfaces" also to Unit1's Uses section. Not it is only in Project1's Uses section.

Juha

evowinds:
I tried but didn't help me so far. Where do I make mistake?

I also tried to install different distro, Pardus, but I had the same error. Fortunately, Lazarus compiling and running an aplication in Pardus even if
"This project does not use the LCL Unit Interfaces but it seems it needs it.
You will get strange linker errors if you use the LCL forms without interfaces
Add unit interfaces-Ignore-Always Ignore-Cancel".
error dialog appears.

Navigation

[0] Message Index

[#] Next page

Go to full version