Sign in Join

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

Mailing lists / lazarus / 2011-07

Can't find unit LResources used by Component1

7 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

John Landmesser

Hi,

try this:

New Package with new component derived from TComponent, select an *.png as icon and compile

I get this error message:

component1.pas(8,22) Fatal: Can't find unit LResources used by Component1

My lazarus
Lazarus 0.9.31 r31679M FPC 2.4.4 i386-linux-gtk 2

Same error for lazarus win XP !

Reply by email

Mattias Gaertner
to John Landmesser
Show quoted text 10 lines
Hi, try this: New Package with new component derived from TComponent, select an *.png as icon and compile I get this error message: component1.pas(8,22) Fatal: Can't find unit LResources used by Component1

Fixed in svn trunk.

My lazarus Lazarus 0.9.31 r31679M FPC 2.4.4 i386-linux-gtk 2 Same error for lazarus win XP !

Mattias

Reply by email

John Landmesser
to Mattias Gaertner
Mattias Gaertner wrote 14 lines
On Tue, 12 Jul 2011 22:20:24 +0200 John Landmesser wrote: > Hi, > > try this: > > New Package with new component derived from TComponent, select an *.png > as icon and compile > > I get this error message: > > component1.pas(8,22) Fatal: Can't find unit LResources used by Component1 Fixed in svn trunk.

fix is ok if you do it the way i explained above BUT:

remove component1.pas from the compiled example package above and add component1.pas again to that package!
I get the error message again: "component1.pas(8,22) Fatal: Can't find unit LResources used by Component1"

And now we are at the root of my real problem - perhaps you remember that thread - add the delphi unit findfile1.pas to a new package with uses

   Classes, SysUtils, , Forms, Controls, Graphics, Dialogs;

I allways get "Can't find unit LResources used by findfile1"

i can add my findfile1.pas to a package if i reduce the uses clause to uses

   Classes, SysUtils ;

But thats no solution, i want a component icon and therefor i need "LResources"

Show quoted text 13 lines
> My lazarus > Lazarus 0.9.31 r31679M FPC 2.4.4 i386-linux-gtk 2 > > Same error for lazarus win XP ! Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mattias Gaertner
to John Landmesser
Show quoted text 7 lines
[...] fix is ok if you do it the way i explained above BUT: remove component1.pas from the compiled example package above and add component1.pas again to that package! I get the error message again: "component1.pas(8,22) Fatal: Can't find unit LResources used by Component1"

Adding a unit to a package does not (yet) validate the uses section(s) of the unit.

Show quoted text 13 lines
And now we are at the root of my real problem - perhaps you remember that thread - add the delphi unit findfile1.pas to a new package with uses Classes, SysUtils, , Forms, Controls, Graphics, Dialogs; I allways get "Can't find unit LResources used by findfile1" i can add my findfile1.pas to a package if i reduce the uses clause to uses Classes, SysUtils ; But thats no solution, i want a component icon and therefor i need "LResources"

Have you tried right clicking on the message?

There should be two menu entries:
- Remove unit from uses section
- Search unit

The second searches in all open packages and allows to add a dependency.

Mattias

Reply by email

John Landmesser
to Mattias Gaertner

Hi Mattias,

all troubles are gone since i realized after ages that i have a corrupted component icon.lrs.

Some experiences i made:
Lazarus IDE is frozen for this compiler directive: {$I findfile1_icon.lrs}
in the actual opened unit and lazarus tells in a message box if i compile the package
"findfile1_icon.lrs doesn't look like a ascii(!!!) file"

"Yes, lazarus i now know its not looking like a ascii file, its a corrupted lazarus resource containing a bitmap. "

Why does the IDE freezes in this situation?
I just sit there looking at the code and the IDE freezes! Does it scan the content of the file mentioned in the directive {$I findfile1_icon.lrs} ?

Hard trouble for a newbee, but i didn't give up :-))

Thanks for your assistance!

John

Mattias Gaertner wrote 43 lines
On Wed, 13 Jul 2011 19:55:35 +0200 John Landmesser wrote: > [...] > fix is ok if you do it the way i explained above BUT: > > remove component1.pas from the compiled example package above and add > component1.pas again to that package! > I get the error message again: "component1.pas(8,22) Fatal: Can't find > unit LResources used by Component1" Adding a unit to a package does not (yet) validate the uses section(s) of the unit. > And now we are at the root of my real problem - perhaps you remember > that thread - add the delphi unit findfile1.pas to a new package with > uses > Classes, SysUtils, , Forms, Controls, Graphics, Dialogs; > > I allways get "Can't find unit LResources used by findfile1" > > i can add my findfile1.pas to a package if i reduce the uses clause to > uses > Classes, SysUtils ; > > But thats no solution, i want a component icon and therefor i need > "LResources" Have you tried right clicking on the message? There should be two menu entries: - Remove unit from uses section - Search unit The second searches in all open packages and allows to add a dependency. Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mattias Gaertner
to John Landmesser
Show quoted text 16 lines
Hi Mattias, all troubles are gone since i realized after ages that i have a corrupted component icon.lrs. Some experiences i made: Lazarus IDE is frozen for this compiler directive: {$I findfile1_icon.lrs} in the actual opened unit and lazarus tells in a message box if i compile the package "findfile1_icon.lrs doesn't look like a ascii(!!!) file" "Yes, lazarus i now know its not looking like a ascii file, its a corrupted lazarus resource containing a bitmap. " Why does the IDE freezes in this situation?

Can you send me this file?

I just sit there looking at the code and the IDE freezes! Does it scan the content of the file mentioned in the directive {$I findfile1_icon.lrs} ?

Yes, of course.

Hard trouble for a newbee, but i didn't give up :-))

Mattias

Reply by email

John Landmesser
to Mattias Gaertner
Mattias Gaertner wrote 22 lines
On Thu, 14 Jul 2011 19:53:24 +0200 John Landmesser wrote: > Hi Mattias, > > all troubles are gone since i realized after ages that i have a > corrupted component icon.lrs. > > Some experiences i made: > Lazarus IDE is frozen for this compiler directive: > {$I findfile1_icon.lrs} > in the actual opened unit and lazarus tells in a message box if i > compile the package > "findfile1_icon.lrs doesn't look like a ascii(!!!) file" > > "Yes, lazarus i now know its not looking like a ascii file, its a > corrupted lazarus resource containing a bitmap. " > > Why does the IDE freezes in this situation? Can you send me this file?

See attachment ...

I used the new compiled lazres.exe from lazarus to produce this resource file and tfindfile.png ( = convertet bitmap using irfanview.exe )

But i used lazres.exe today again and the result is ok, so just look for the freezing IDE , i suggest.

By the way /lazarus/examples/lazresexplorer/ -> error if you try to open a perfect *.lrs

Access violation. Press OK to ignore and risk data corruption. Press Cancel to kill the program.

Should this app be able to show the image in *.lrs ? -------------- next part --------------
A non-text attachment was scrubbed...
Name: Tfindfile.png
Type: image/png
Size: 224 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110714/bbf83e31/attachment-0001.png> -------------- next part --------------
A non-text attachment was scrubbed...
Name: findfile1.lrs
Type: application/octet-stream
Size: 440 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110714/bbf83e31/attachment-0001.obj> -------------- next part --------------
A non-text attachment was scrubbed...
Name: findfile1.pas
Type: text/x-pascal
Size: 8372 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110714/bbf83e31/attachment-0001.bin>

Reply by email