Recent

Author Topic: LCL Unit Interface Fault?  (Read 8105 times)

evowinds

  • New member
  • *
  • Posts: 7
LCL Unit Interface Fault?
« 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"

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: [Select]
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.     

Code: [Select]
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.   
« Last Edit: April 09, 2010, 08:49:54 am by evowinds »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8766
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: LCL Unit Interface Fault?
« Reply #1 on: April 09, 2010, 09:28:02 am »
Nothing is wrong in your code. But could you please check Project Inspector? Make sure it depends on LCL.

evowinds

  • New member
  • *
  • Posts: 7
Re: LCL Unit Interface Fault?
« Reply #2 on: April 09, 2010, 09:37:53 am »
Yes it has a dependency on LCL. What for next?

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4498
  • I like bugs.
Re: LCL Unit Interface Fault?
« Reply #3 on: April 19, 2010, 09:29:08 pm »
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"

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

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

evowinds

  • New member
  • *
  • Posts: 7
Re: LCL Unit Interface Fault?
« Reply #4 on: April 20, 2010, 06:18:02 am »
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.
« Last Edit: April 20, 2010, 06:20:50 am by evowinds »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8766
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: LCL Unit Interface Fault?
« Reply #5 on: April 20, 2010, 06:24:14 am »
Lazarus and FPC version (if you use pre-compiled packages, post their names)?

evowinds

  • New member
  • *
  • Posts: 7
Re: LCL Unit Interface Fault?
« Reply #6 on: April 20, 2010, 06:51:16 am »
binutils
binutils-avr
fpc:2.2.4
fpcsrc
lazarus :0.9.28.2
make
SVN Revision:22279

 

TinyPortal © 2005-2018