Programming => Graphics => Graphics and Multimedia => BGRABitmap and LazPaint => Topic started by: Markus on April 09, 2025, 12:05:10 pm
Title: Cannot find LazUTF8Classes
Post by: Markus on April 09, 2025, 12:05:10 pm
I just updated Lazarus from version 2.2.6 to 3.8.
Trying to compile my actual project now produces this error:
Cannot find LazUTF8Classes used by BGRAUTF8 of package BGRABitmapPack
Unfortunately I don't understand the discussion on this topic in other forum threads, since I am not a Lazarus developer.
Anyone who could help?
Title: Re: Cannont find LazUTF8Classes
Post by: cdbc on April 09, 2025, 12:14:26 pm
Hi Add 'LazUtils' package as a dependency to your project. "Project" -> "Project Inspector" -> "Add" -> "Requirement" ...look for 'LazUtils' -> recompile "and Bob's your uncle" Regards Benny
Title: Re: Cannont find LazUTF8Classes
Post by: Markus on April 09, 2025, 12:48:55 pm
I have now done that, restarted Lazarus, but the error still remains. :(
Title: Re: Cannont find LazUTF8Classes
Post by: Markus on April 09, 2025, 12:55:49 pm
The error turns up in the uses-list in BGRAUTF8.pas
Title: Re: Cannont find LazUTF8Classes
Post by: Martin_fr on April 09, 2025, 01:31:09 pm
Does the BGRABitmapPack (which gives the error) have LazUtils as dependency?
Have you tried to open that package, and done "compile clean" (from the drop down, at the right end of the toolbar)?
If the error remains, then this may be an old issue in fpc. Open the Package LazUtils and recompile it twice - first clean - then just compile (no clean) Then build the project (should recompile the bgra package)
If it still remains, then open LazUtil again, and recompile it with the "custom option" -Ur (I thing -Ur, not sure might be -UR / check fpc doc for "build release ppu). Mind that if you do that, and you make changes in your copy of LazUtils, it will not rebuild. You must trigger that by manually rebuild clean.
Title: Re: Cannont find LazUTF8Classes
Post by: Markus on April 09, 2025, 02:19:28 pm
I don't find the function "compile clean". Do you mean "Clean up and Build"? This one does not solve the problem.
Title: Re: Cannont find LazUTF8Classes
Post by: Markus on April 09, 2025, 02:58:34 pm
After searching, I guess, you mean Package > Open Loaded Package > LazUtils > More > Recompile Clean..
This does not solve the problem.
I also tested the -Ur parameter, which does not change the problem.
Title: Re: Cannont find LazUTF8Classes
Post by: dsiders on April 09, 2025, 04:00:59 pm
Hi Add 'LazUtils' package as a dependency to your project. "Project" -> "Project Inspector" -> "Add" -> "Requirement" ...look for 'LazUtils' -> recompile "and Bob's your uncle" Regards Benny
And where is it in LazUtils 3.8 that LazUtf8Classes.pas is located? Nowhere. He needs to update the BGRA package too.
Title: Re: Cannot find LazUTF8Classes
Post by: cdbc on April 09, 2025, 04:35:54 pm
Ouch... My bad - Sorry. I still have 3.6 and I dunno how old my BGRABitmat is... %) Regards Benny
Title: Re: Cannot find LazUTF8Classes
Post by: Markus on April 09, 2025, 07:04:56 pm
I already deinstalled Lazarus and re-installed everything new. No change.
To be sure, I again used Package > Online Package Manager to install BGRABitmap and BGRAControls.
During compilation, it said "Cannot install package: "bgrabitmappack4fpgui.lpk", but this was the only error.
Now, I get the following Error: bgrautf8.pas(10,72) Error: Cannot find lazutf8classes used by BGRAUTF8 of package BGRABitmapPack.
You tried to use a unit of which the PPU file isn't found by the compiler. Check your configuration file for the unit paths.
If nothing helps, I have to downdate back to my previous version 2.2.6.
Title: Re: Cannot find LazUTF8Classes
Post by: paweld on April 09, 2025, 07:13:21 pm
Install a new version of BGRABitmap - using Online Package Manager or download the package sources from: https://github.com/bgrabitmap/bgrabitmap/archive/refs/tags/v11.6.4.zip unpack archive and install using Menu > Package > Open Package File (*.lpk). You get an error because you are trying to install an older version of the BGRABitmap package, which only works well with FPC 3.2.0 and below
Title: Re: Cannot find LazUTF8Classes
Post by: JuhaManninen on April 09, 2025, 07:59:16 pm
He wrote he used Package > Online Package Manager to install BGRABitmap and BGRAControls. Does OPM have the latest version?
Title: Re: Cannot find LazUTF8Classes
Post by: Markus on April 09, 2025, 08:17:16 pm
I have used the online package manager. The version of BGRABitmapPack is 11.6.4.
See the image.
Title: Re: Cannot find LazUTF8Classes
Post by: paweld on April 09, 2025, 08:35:08 pm
Then you have installed the package from a different folder, or you have some symbolic link to the BGRAUTF8.pas file in an older version. A while ago I downloaded the component using OPM (update date 2025-03-17) and the file is correct, while yours is not - see attachments.
Search for all occurrences of the BGRAUTF8.pas file on disk (in the Lazarus directory and configuration folder) and delete old versions of the component. For everything before deleting, make a backup
Title: Re: Cannot find LazUTF8Classes
Post by: Markus on April 09, 2025, 08:57:19 pm
:D :D :D YES! Now it works!
This was the problem! Big thanks to your patience!
I am really still confused how this could happen, even after using the online package manager. I can see that the faulty BGRAUTF8.pas had been modified (=installed) today after 18h, so it really confuses me that I got it then.
Could that be due to that I did not delete all user settings before re-installing Lazarus?
Title: Re: Cannot find LazUTF8Classes
Post by: circular on April 12, 2025, 09:25:56 am
Maybe the file BGRAUTF8 was opened in an editor, and after the update by OPM, the editor proposed to save the previous version.