Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-07

Fatal [Error]: Can't find unit URIParser used by XMLRead

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Peter Williams

Hello All Lazarus Users,

I'm getting a very odd error message when I try to build the following simple project.

Error message:

do_the_macarena.lpr(1,1) Fatal: Can't find unit URIParser used by XMLRead
----- file "do_the_macarena.lpr "
program do_the_macarena;
{$mode objfpc}{$H+}

uses

  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms
  { you can add units after this }, Unit1;
begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.
------- end of lpr file.
------ file "unit1.pas"
unit Unit1;
{$mode objfpc}{$H+}
interface

uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,

  ExtCtrls;
type
  { TForm1 }
  TForm1 = class(TForm)
    Edit1: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Timer1: TTimer;
    procedure Edit1KeyUp(Sender: TObject; var Key: Word; Shift:
TShiftState);
    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;
var
  Form1: TForm1;
Type
  STR03 = STRING[3];
Const
  MaxIndex = 16;
  Dance : array[1..3,1..MaxIndex] of STR03 =
    ((' o ', ' o ', ' o ', ' o ', ' o ', ' o ', '<o ', '<o>', ' o>', ' o ',
' o ', ' o ', ' o ', ' o ', ' o ', ' o '),
     ('^|\', '^|^', 'v|^', 'v|v', '|/v', '|X|', ' \|', ' | ', ' \ ', ' x ',
'</ ', '<|>', '</>', '<\>', '<)>', ' |\'),
     (' /\', ' >\', '/< ', ' >\', '/< ', ' >\', '/< ', ' >\', '/< ', ' >\',
'/< ', ' >\', '/< ', ' >\', ' >>', ' L '));
Var
  Index : integer;
  Edit1_Increment : integer;
implementation

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
  Timer1.enabled := false;
  Form1.Caption := 'Mr Ascii dancing Macarena...';
  Edit1_Increment := 10;
  // start at 200msec delay
  Timer1.Interval := 200;
  try
    Edit1.Text := InttoStr(Timer1.Interval);
  except
    showmessage( 'Sorry... not a valid integer');
  end;
  Index := 1;
  Timer1.enabled := true;
end;
{----------------------------------------------------------------}
procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word; Shift:
TShiftState);
begin
  Timer1.Interval := StrtoIntDef(Edit1.Text,1) +
  Edit1_Increment
end;
{----------------------------------------------------------------}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Timer1.enabled := false;
  Label1.Caption := Dance[ 1,index ] + #13 +
                    Dance[ 2,index ] + #13 +
                    Dance[ 3,index ];
  index := (index mod MaxIndex) + 1;
  Timer1.enabled := true;
end;
{----------------------------------------------------------------}
initialization
  {$I unit1.lrs}
end.
----- end of file "unit1"
Fond Regards, Peter Eric (aka 'pew') WILLIAMS My free website is: http://pewtas.googlepages.com (or) http://tinyurl.com/yuyejs (please visit my free website and let me know what you think about it.) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080725/bc19624c/attachment.html

Reply by email

Mattias Gaertner
to Peter Williams
Show quoted text 9 lines
Hello All Lazarus Users, I'm getting a very odd error message when I try to build the following simple project. Error message: do_the_macarena.lpr(1,1) Fatal: Can't find unit URIParser used by XMLRead

http://wiki.lazarus.freepascal.org/Unit_not_found_-_How_to_find_units

Mattias

Show quoted text 116 lines
----- file "do_the_macarena.lpr " program do_the_macarena; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Interfaces, // this includes the LCL widgetset Forms { you can add units after this }, Unit1; begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end. ------- end of lpr file. ------ file "unit1.pas" unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls; type { TForm1 } TForm1 = class(TForm) Edit1: TEdit; Label1: TLabel; Label2: TLabel; Timer1: TTimer; procedure Edit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); procedure FormCreate(Sender: TObject); procedure Timer1Timer(Sender: TObject); private { private declarations } public { public declarations } end; var Form1: TForm1; Type STR03 = STRING[3]; Const MaxIndex = 16; Dance : array[1..3,1..MaxIndex] of STR03 = ((' o ', ' o ', ' o ', ' o ', ' o ', ' o ', '<o ', '<o>', ' o>', ' o ', ' o ', ' o ', ' o ', ' o ', ' o ', ' o '), ('^|\', '^|^', 'v|^', 'v|v', '|/v', '|X|', ' \|', ' | ', ' \ ', ' x ', '</ ', '<|>', '</>', '<\>', '<)>', ' |\'), (' /\', ' >\', '/< ', ' >\', '/< ', ' >\', '/< ', ' >\', '/< ', ' >\', '/< ', ' >\', '/< ', ' >\', ' >>', ' L ')); Var Index : integer; Edit1_Increment : integer; implementation { TForm1 } procedure TForm1.FormCreate(Sender: TObject); begin Timer1.enabled := false; Form1.Caption := 'Mr Ascii dancing Macarena...'; Edit1_Increment := 10; // start at 200msec delay Timer1.Interval := 200; try Edit1.Text := InttoStr(Timer1.Interval); except showmessage( 'Sorry... not a valid integer'); end; Index := 1; Timer1.enabled := true; end; {----------------------------------------------------------------} procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin Timer1.Interval := StrtoIntDef(Edit1.Text,1) + Edit1_Increment end; {----------------------------------------------------------------} procedure TForm1.Timer1Timer(Sender: TObject); begin Timer1.enabled := false; Label1.Caption := Dance[ 1,index ] + #13 + Dance[ 2,index ] + #13 + Dance[ 3,index ]; index := (index mod MaxIndex) + 1; Timer1.enabled := true; end; {----------------------------------------------------------------} initialization {$I unit1.lrs} end. ----- end of file "unit1"

Reply by email

Peter Williams
to Mattias Gaertner

Hi Mattias and All Others,

2008/7/25 Mattias Gaertner :

Show quoted text 15 lines
On Fri, 25 Jul 2008 09:05:24 +1000 "Peter Williams" wrote: > Hello All Lazarus Users, > > I'm getting a very odd error message when I try to build the following > simple project. > > Error message: > > do_the_macarena.lpr(1,1) Fatal: Can't find unit URIParser used by > XMLRead http://wiki.lazarus.freepascal.org/Unit_not_found_-_How_to_find_units

I used the search app of my Linux Kubuntu OS and found that the 'missing unit' actually exists TWICE on my system. However I don't understand what setting I need to change to make Lazarus (or Free Pascal Compiler) find a copy of the unit. Please help me if you can.

/usr/share/fpcsrc/packages/base/netdb/uriparser.pp /usr/share/fpcsrc/utils/fppkg/fcl20/uriparser.pp

Also, it is mystery to me why Lazarus (or FPC) even wants these units, as I'm not parsing anything nor creating XML files.

Finally, can someone who is responsible for the Free Pascal Compiler please delete one of the copies of "uriparser.pp" -- since I believe that it is wrong for it to be included twice... once should be enough. Also, having the file twice increases the possibility of errors ('cos you don't know which copy will be used).

I *DID READ* the URL page listed above... and with all due respect it is the biggest load of gibberish that I've read in a long time!!! For example, it [the article] asks me to determine whether or not Free Pascal Compiler or Lazarus can find the missing unit -- without telling me how to find out! *THIS IS EXTREMELY FRUSTRATING !!!!*

Hopefully looking forward to some help. Thanks in advance. *SMILE*

Fond Regards,
PEW

Show quoted text 126 lines
Mattias > > ----- file "do_the_macarena.lpr " > program do_the_macarena; > > {$mode objfpc}{$H+} > > uses > {$IFDEF UNIX}{$IFDEF UseCThreads} > cthreads, > {$ENDIF}{$ENDIF} > Interfaces, // this includes the LCL widgetset > Forms > { you can add units after this }, Unit1; > > begin > Application.Initialize; > Application.CreateForm(TForm1, Form1); > Application.Run; > end. > ------- end of lpr file. > > ------ file "unit1.pas" > unit Unit1; > > {$mode objfpc}{$H+} > > interface > > uses > Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, > StdCtrls, > ExtCtrls; > > type > > { TForm1 } > > TForm1 = class(TForm) > Edit1: TEdit; > Label1: TLabel; > Label2: TLabel; > Timer1: TTimer; > procedure Edit1KeyUp(Sender: TObject; var Key: Word; Shift: > TShiftState); > procedure FormCreate(Sender: TObject); > procedure Timer1Timer(Sender: TObject); > private > { private declarations } > public > { public declarations } > end; > > var > Form1: TForm1; > > Type > STR03 = STRING[3]; > Const > MaxIndex = 16; > Dance : array[1..3,1..MaxIndex] of STR03 = > ((' o ', ' o ', ' o ', ' o ', ' o ', ' o ', '<o ', '<o>', ' o>', > ' o ', ' o ', ' o ', ' o ', ' o ', ' o ', ' o '), > ('^|\', '^|^', 'v|^', 'v|v', '|/v', '|X|', ' \|', ' | ', ' \ ', > ' x ', '</ ', '<|>', '</>', '<\>', '<)>', ' |\'), > (' /\', ' >\', '/< ', ' >\', '/< ', ' >\', '/< ', ' >\', '/< ', > ' >\', '/< ', ' >\', '/< ', ' >\', ' >>', ' L ')); > Var > Index : integer; > Edit1_Increment : integer; > > implementation > > { TForm1 } > > procedure TForm1.FormCreate(Sender: TObject); > begin > Timer1.enabled := false; > Form1.Caption := 'Mr Ascii dancing Macarena...'; > Edit1_Increment := 10; > // start at 200msec delay > Timer1.Interval := 200; > try > Edit1.Text := InttoStr(Timer1.Interval); > except > showmessage( 'Sorry... not a valid integer'); > end; > Index := 1; > Timer1.enabled := true; > end; > {----------------------------------------------------------------} > > procedure TForm1.Edit1KeyUp(Sender: TObject; var Key: Word; Shift: > TShiftState); > begin > Timer1.Interval := StrtoIntDef(Edit1.Text,1) + > Edit1_Increment > end; > {----------------------------------------------------------------} > > procedure TForm1.Timer1Timer(Sender: TObject); > begin > Timer1.enabled := false; > Label1.Caption := Dance[ 1,index ] + #13 + > Dance[ 2,index ] + #13 + > Dance[ 3,index ]; > index := (index mod MaxIndex) + 1; > Timer1.enabled := true; > end; > {----------------------------------------------------------------} > > initialization > {$I unit1.lrs} > > end. > ----- end of file "unit1" > _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Fond Regards, Peter Eric (aka 'pew') WILLIAMS My free website is: http://pewtas.googlepages.com (or) http://tinyurl.com/yuyejs (please visit my free website and let me know what you think about it.) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080725/ab748a42/attachment.html

Reply by email

Mattias Gaertner
to Peter Williams
Show quoted text 30 lines
Hi Mattias and All Others, 2008/7/25 Mattias Gaertner : > On Fri, 25 Jul 2008 09:05:24 +1000 > "Peter Williams" wrote: > > > Hello All Lazarus Users, > > > > I'm getting a very odd error message when I try to build the > > following simple project. > > > > Error message: > > > > do_the_macarena.lpr(1,1) Fatal: Can't find unit URIParser used by > > XMLRead > > http://wiki.lazarus.freepascal.org/Unit_not_found_-_How_to_find_units > I used the search app of my Linux Kubuntu OS and found that the 'missing unit' actually exists TWICE on my system. However I don't understand what setting I need to change to make Lazarus (or Free Pascal Compiler) find a copy of the unit. Please help me if you can. /usr/share/fpcsrc/packages/base/netdb/uriparser.pp /usr/share/fpcsrc/utils/fppkg/fcl20/uriparser.pp Also, it is mystery to me why Lazarus (or FPC) even wants these units, as I'm not parsing anything nor creating XML files.

The LCL uses xmlread.

Show quoted text 5 lines
Finally, can someone who is responsible for the Free Pascal Compiler please delete one of the copies of "uriparser.pp" -- since I believe that it is wrong for it to be included twice... once should be enough. Also, having the file twice increases the possibility of errors ('cos you don't know which copy will be used).

True, but I guess, this is not your error.
I will add this to the wiki.

Show quoted text 5 lines
I *DID READ* the URL page listed above... and with all due respect it is the biggest load of gibberish that I've read in a long time!!! For example, it [the article] asks me to determine whether or not Free Pascal Compiler or Lazarus can find the missing unit -- without telling me how to find out! *THIS IS EXTREMELY FRUSTRATING !!!!*

Well, my english is not good, but the information is there:

"If the compiler can not find it, the compilation fails (Build, Ctrl+F9) with the error 'unit not found'."

"If the IDE can not find, the code tools will fail. For example Find Declaration (Alt+Up or Ctrl+Left mouse button) or Identifier completion (Ctrl+Space) will fail with the same error 'unit not found'."

You are welcome to improve the wiki text.

I guess, you have

"case 3: IDE finds a unit, but compiler does not

This is the case, when Find Declaration finds the unit, but building (Ctrl+F9) fails. "

Hopefully looking forward to some help. Thanks in advance. *SMILE*

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner
Mattias Gaertner wrote 6 lines
I guess, you have "case 3: IDE finds a unit, but compiler does not This is the case, when Find Declaration finds the unit, but building (Ctrl+F9) fails. "

Which normally means that the unit paths in /etc/fpc.cfg file or the $HOME/.fpc.cfg file are incorrect. That's if you are running Linux. I have no idea where those files live under Windows.

To test if that's the problem (which in my experiences normally is), create a simple Free Pascal program (no LCL) and include something like the SysUtils or fpcunit units and try and compile the program from the command line: fpc project1.pas
If that fails, it's your FPC setup and not Lazarus.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email