Recent

Author Topic: Can't find unit FileUtil used by LResources  (Read 11137 times)

tantek

  • Newbie
  • Posts: 4
Can't find unit FileUtil used by LResources
« on: October 01, 2012, 04:08:06 pm »
I am trying to install the following component packages:
"Sdpo-0.2.0.zip" downloaded from here:  http://sourceforge.net/projects/sdpo-cl/
and
"opengpsx0.3.23.zip" downloaded from here:  http://sourceforge.net/projects/opengpsx/

The Sdpo works fine, so I think I am using the correct steps to install it.  But the opengpsx won't compile.  Following are the steps I use for both packages.  I have installed Lazarus on a PC (Windows XP SP3) for the first time, and none of the Lazarus settings have been changed at all.  I hope that the following steps are therefore repeatable by anyone, and that the problem can easily be seen.

1.  Install "lazarus-1.0-fpc-2.6.0-win32.exe" to default "C:\lazarus".  Change NO Lazarus settings.
2.  Unzip "Sdpo-0.2.0.zip" to "C:\lazarus\components".
3.  Package > Open Package File (.lpk) ....
4.  Select "C:\lazarus\components\Sdpo\SdpoSerial\sdposeriallaz.lpk".
5.  Click Compile.  Compiled successfully.
6.  Click Use >> > Install.
7.  "Do you want to rebuild Lazarus now?" – click Yes.
8.  Lazarus restarted.

9.  Unzip "opengpsx0.3.23.zip" to "C:\lazarus\components".
10.  Package > Open Package File (.lpk) ....
11.  Select "C:\lazarus\components\opengpsx\opengpsx.lpk".
12.  Click Compile.
Error in Messages window:
"..\..\lcl\lresources.pp(39,40) Fatal: Can't find unit FileUtil used by LResources"
Source Editor has line 39 of LResources highlighted in orange.
-------------------------------

I have searched for answers to this "Can't find unit FileUtil" problem – it seems many people have seen similar problems over years, but I can't find a recent case that has actually been solved.

A Lazarus developer has told me it is not a problem with Lazarus, but I found another user had this problem in 2010 (with some other source) and he solved it by downgrading to an older version of Lazarus.

Can anyone help please?

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Can't find unit FileUtil used by LResources
« Reply #1 on: October 01, 2012, 04:23:52 pm »
Thanks for the clear post.

I think you're very close!

After this:
Quote
11.  Select "C:\lazarus\components\opengpsx\opengpsx.lpk".
if you go down to Required Packages, you see only FCL, which is the Free Component Library.
FileUtil is part of Lazarus.
Click the Add button, New Requirement,... package name unfortunately has no fileutil.
I selected lclbase (to see if that would work, it probably contains fileutil and other needed units - but that ), create requirement

Then click save for good measure

Click compile=>now the fileutil warning goes away, but it complains about 5dpo:
Quote
gpsportconnected.pas(0,0) Fatal: Can not find unit sdposerial used by gpsportconnected. Check if package SdpoSerialLaz is in the dependencies.

... so add another depency requirement like we just did but with sdposeriallaz
Then click compile.

Sorry my Laz 1.0 install is a bit messed up so I can't check if this actually works, but you could give it a go.

If it does, perhaps it's a good idea to send the fixed opengpsx.lpk to the maintainer at sourceforge so he can update his package for Lazarus 1.0...

Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

tantek

  • Newbie
  • Posts: 4
Re: Can't find unit FileUtil used by LResources
« Reply #2 on: October 01, 2012, 05:11:28 pm »
Thank you very much for your quick response BigChimp.

Sorry – I don't understand the significance of this in relation to the problem: "...FCL, which is the Free Component Library."

And if "FileUtil is part of Lazarus" then why can't it be found?  If I start a New Application, I get this in the code for Unit1 showing in the Source Editor:
uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs;

FileUtil is right there, and I can run or compile Unti1 without any problem – seems odd to me then that FileUtil can't be found when trying to compile opengpsx.

Getting back to your post, you say "I selected lclbase ..." – is there any way of finding out if lclbase contains fileutil?

It's now after 11:00pm here, so I'll try your suggestions in the morning.

Thanks again.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Can't find unit FileUtil used by LResources
« Reply #3 on: October 01, 2012, 05:34:01 pm »
Some of the "can't find" compiler messages are somewhat misleading, because in some of the "can't find" situations is is not that the required .ppu is not found, but that (having found it) the compiler rejects it for some reason (e. g. it's slightly out of date).
Ususally the simplest solution is to uninstall Lazarus completely, clean the Lazarus folders (or delete them altogether) and reinstall Lazarus.
I've usually found this is far quicker than trying to locate and restore a supposedly missing file.
Sometimes Lazarus dpendencies get screwed up through installing/uninstalling packages or tinkering with source, or for a variety of other (unknown to you) reasons that are platform dependent, so there is no one-size-fits-all solution. If that seems to be the case, the quickest solution is to go for a full Monty clean install.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Can't find unit FileUtil used by LResources
« Reply #4 on: October 01, 2012, 07:25:49 pm »
Sorry – I don't understand the significance of this in relation to the problem: "...FCL, which is the Free Component Library."

And if "FileUtil is part of Lazarus" then why can't it be found?  If I start a New Application, I get this in the code for Unit1 showing in the
If you create a new project in Lazarus, Lazarus adds the LCL as a dependency to your project. Try creating a new project, then go to project/project inspector. You'll notice that Lazarus added the LCL as a required package/dependency for you. That's why Lazarus knows where to find Lazarus units such as FileUtil in your project.

I suppose not every .lpk package needs to contain LCL/Lazarus code; it can also just contain FPC/FCL code. It's up to the package developer to specify the dependencies himself.

As for finding out if lclbase contains fileutil, yes there must be.... have looked a bit in the Laz menus but haven't figured it out yet though.
Perhaps some Laz guru has an answer here..
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

tantek

  • Newbie
  • Posts: 4
Re: Can't find unit FileUtil used by LResources
« Reply #5 on: October 04, 2012, 02:31:06 pm »
... the quickest solution is to go for a full Monty clean install.
Thanks howardpc - um...have a look at my original post again - you'll see I started 100% clean.  Any other suggestions?

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Can't find unit FileUtil used by LResources
« Reply #6 on: October 04, 2012, 02:38:28 pm »
@tantek: did my suggestions not solve your problems?
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

tantek

  • Newbie
  • Posts: 4
Re: Can't find unit FileUtil used by LResources
« Reply #7 on: October 04, 2012, 02:57:24 pm »
Thanks BigChimp,

I tried your suggestion - I added LCL.  That got past the fileutil problem, but compiling opengpsx then stopped with:
gpsportconnected.pas(29,3) Fatal: Can not find SdpoSerial used by gpsportconnected, ppu=..\Sdpo\SdpoSerial\lib\i386-win32\sdposerial.ppu, package SdpoSerialLaz

So I tried re-compiling and installing sdposerial, but still get the same error.

You said:
... so add another depency requirement like we just did but with sdposeriallaz

Well I've tried adding SdpoSerialLaz as a Required Package to opengpsx, but still the same error is given.  Any other suggestions please?

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Can't find unit FileUtil used by LResources
« Reply #8 on: October 04, 2012, 03:11:03 pm »
No, sorry.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

drugis

  • Newbie
  • Posts: 1
Re: Can't find unit FileUtil used by LResources
« Reply #9 on: September 06, 2017, 09:23:53 pm »
About prob: gpsportconnected.pas(29,3) Fatal: Can not find SdpoSerial used by gpsportconnected, ppu=..\Sdpo\SdpoSerial\lib\i386-win32\sdposerial.ppu, package SdpoSerialLaz

Quick and dirty fix in windows: copy sdposerial.pas from SdpoSerial folder to your opengpsx folder.
Linux was fine.

 

TinyPortal © 2005-2018