Recent

Author Topic: Upgrade Lazarus, nothing compiles  (Read 4257 times)

Bazzao

  • Full Member
  • ***
  • Posts: 178
  • Pies are squared.
Upgrade Lazarus, nothing compiles
« on: September 29, 2020, 05:37:09 am »
Hi I upgraded Lazarus, and nothing compiles.

Here is an example:

Messages, Hints: 20
Note: Duplicate unit "translations" in "LazUtils 1.0", ppu="C:\Lazarus\components\lazutils\lib\x86_64-win64\translations.ppu", source="C:\Lazarus\components\lazutils\translations.pas"
Note: Duplicate unit "translations" in "LCLBase 2.0.10", ppu="C:\Lazarus\lcl\units\x86_64-win64\translations.ppu", source="C:\Lazarus\lcl\translations.pas"
Note: Duplicate unit "textstrings" in "LazUtils 1.0", ppu="C:\Lazarus\components\lazutils\lib\x86_64-win64\textstrings.ppu", source="C:\Lazarus\components\lazutils\textstrings.pas"
Note: Duplicate unit "textstrings" in "LCLBase 2.0.10", ppu="C:\Lazarus\lcl\units\x86_64-win64\textstrings.ppu", source="C:\Lazarus\lcl\textstrings.pas"
Note: Duplicate unit "stringhashlist" in "LazUtils 1.0", ppu="C:\Lazarus\components\lazutils\lib\x86_64-win64\stringhashlist.ppu", source="C:\Lazarus\components\lazutils\stringhashlist.pas"
Note: Duplicate unit "stringhashlist" in "LCLBase 2.0.10", ppu="C:\Lazarus\lcl\units\x86_64-win64\stringhashlist.ppu", source="C:\Lazarus\lcl\stringhashlist.pas"
Note: Duplicate unit "maps" in "LazUtils 1.0", ppu="C:\Lazarus\components\lazutils\lib\x86_64-win64\maps.ppu", source="C:\Lazarus\components\lazutils\maps.pp"
Note: Duplicate unit "maps" in "LCLBase 2.0.10", ppu="C:\Lazarus\lcl\units\x86_64-win64\maps.ppu", source="C:\Lazarus\lcl\maps.pp"
Note: Duplicate unit "lazlinkedlist" in "LazUtils 1.0", ppu="C:\Lazarus\components\lazutils\lib\x86_64-win64\lazlinkedlist.ppu", source="C:\Lazarus\components\lazutils\lazlinkedlist.pas"
Note: Duplicate unit "lazlinkedlist" in "LCLBase 2.0.10", ppu="C:\Lazarus\lcl\units\x86_64-win64\lazlinkedlist.ppu", source="C:\Lazarus\lcl\lazlinkedlist.pas"
Note: Duplicate unit "graphtype" in "LazUtils 1.0", ppu="C:\Lazarus\components\lazutils\lib\x86_64-win64\graphtype.ppu", source="C:\Lazarus\components\lazutils\graphtype.pp"
Note: Duplicate unit "graphtype" in "LCLBase 2.0.10", ppu="C:\Lazarus\lcl\units\x86_64-win64\graphtype.ppu", source="C:\Lazarus\lcl\graphtype.pp"
Note: Duplicate unit "extendedstrings" in "LazUtils 1.0", ppu="C:\Lazarus\components\lazutils\lib\x86_64-win64\extendedstrings.ppu", source="C:\Lazarus\components\lazutils\extendedstrings.pas"
Note: Duplicate unit "extendedstrings" in "LCLBase 2.0.10", ppu="C:\Lazarus\lcl\units\x86_64-win64\extendedstrings.ppu", source="C:\Lazarus\lcl\extendedstrings.pas"
Note: Duplicate unit "dynqueue" in "LazUtils 1.0", ppu="C:\Lazarus\components\lazutils\lib\x86_64-win64\dynqueue.ppu", source="C:\Lazarus\components\lazutils\dynqueue.pas"
Note: Duplicate unit "dynqueue" in "LCLBase 2.0.10", ppu="C:\Lazarus\lcl\units\x86_64-win64\dynqueue.ppu", source="C:\Lazarus\lcl\dynqueue.pas"
Note: Duplicate unit "dynhasharray" in "LazUtils 1.0", ppu="C:\Lazarus\components\lazutils\lib\x86_64-win64\dynhasharray.ppu", source="C:\Lazarus\components\lazutils\dynhasharray.pp"
Note: Duplicate unit "dynhasharray" in "LCLBase 2.0.10", ppu="C:\Lazarus\lcl\units\x86_64-win64\dynhasharray.ppu", source="C:\Lazarus\lcl\dynhasharray.pp"
Note: Duplicate unit "dynamicarray" in "LazUtils 1.0", ppu="C:\Lazarus\components\lazutils\lib\x86_64-win64\dynamicarray.ppu", source="C:\Lazarus\components\lazutils\dynamicarray.pas"
Note: Duplicate unit "dynamicarray" in "LCLBase 2.0.10", ppu="C:\Lazarus\lcl\units\x86_64-win64\dynamicarray.ppu", source="C:\Lazarus\lcl\dynamicarray.pas"
Hint: (11030) Start of reading config file C:\Lazarus\fpc\3.0.2\bin\x86_64-win64\fpc.cfg
Hint: (11031) End of reading config file C:\Lazarus\fpc\3.0.2\bin\x86_64-win64\fpc.cfg
Free Pascal Compiler version 3.0.2 [2017/02/27] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
(1002) Target OS: Win64 for x64
(3104) Compiling Colours2.lpr
(10001) PPU Loading C:\Lazarus\lcl\units\x86_64-win64\forms.ppu
(10008) PPU Invalid Version 207
D:\Lazarus\Build\Colours2\Colours2.lpr(6,3) Fatal: (10022) Can't find unit Forms used by Colours2
Fatal: (1018) Compilation aborted
Error: C:\Lazarus\fpc\3.0.2\bin\x86_64-win64\ppcx64.exe returned an error exitcode
Bazza

Lazarus 2.0.10; FPC 3.2.0; SVN Revision 63526; x86_64-win64-win32/win64
Windows 10.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Upgrade Lazarus, nothing compiles
« Reply #1 on: September 29, 2020, 07:14:59 am »
Your tagline indicates "Lazarus 2.0.10; FPC 3.2.0; SVN Revision 63526; x86_64-win64-win32/win64"

Your failed compilation indicates that you're using Lazarus 2.0.10 and FPC 3.0.2, so I'm not surprised it doesn't work.

I don't use Windows, but I believe you can fix the FPC version by specifying it in Tools > Options > Files - Compiler executable and a matching Tools > Options > Files - FPC source directory.

Bazzao

  • Full Member
  • ***
  • Posts: 178
  • Pies are squared.
Re: Upgrade Lazarus, nothing compiles
« Reply #2 on: September 29, 2020, 07:41:57 am »
$(LazarusDir)fpc\$(FPCVer)\source

Where do I decode or set $(FPCVer)?

Bazza

Lazarus 2.0.10; FPC 3.2.0; SVN Revision 63526; x86_64-win64-win32/win64
Windows 10.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Upgrade Lazarus, nothing compiles
« Reply #3 on: September 29, 2020, 08:09:11 am »
Mine are hardcoded - for example:

FPC Executable (one of):
* /usr/local/lib/fpc/3.3.1/ppc386
* /usr/local/lib/fpc/3.3.1/ppcx64

* /usr/local/lib/fpc/3.2.0/ppc386
* /usr/local/lib/fpc/3.2.0/ppcx64

FPC Source (one of):
* /usr/local/share/fpcsrc/fpc-3.3.1/

* /usr/local/share/fpcsrc/fpc-3.2.0/

It would depend on where you have your files.

Bazzao

  • Full Member
  • ***
  • Posts: 178
  • Pies are squared.
Re: Upgrade Lazarus, nothing compiles
« Reply #4 on: September 29, 2020, 08:58:43 am »
OK,

* I moved the 3.0.2 directory & rescanned FPC source.
* hardcoded the paths like you.
* I've edited the fpc.cfg to add my unit paths.

Now all that remains is the duplicates ...

Quote
Note: Duplicate unit "translations" in "LazUtils 1.0", ppu="C:\Lazarus\components\lazutils\lib\x86_64-win64\translations.ppu", source="C:\Lazarus\components\lazutils\translations.pas"
Note: Duplicate unit "translations" in "LCLBase 2.0.10", ppu="C:\Lazarus\lcl\units\x86_64-win64\translations.ppu", source="C:\Lazarus\lcl\translations.pas"

Note: Duplicate unit "textstrings" in "LazUtils 1.0", ppu="C:\Lazarus\components\lazutils\lib\x86_64-win64\textstrings.ppu", source="C:\Lazarus\components\lazutils\textstrings.pas"
Note: Duplicate unit "textstrings" in "LCLBase 2.0.10", ppu="C:\Lazarus\lcl\units\x86_64-win64\textstrings.ppu", source="C:\Lazarus\lcl\textstrings.pas"

Note: Duplicate unit "stringhashlist" in "LazUtils 1.0", ppu="C:\Lazarus\components\lazutils\lib\x86_64-win64\stringhashlist.ppu", source="C:\Lazarus\components\lazutils\stringhashlist.pas"
Note: Duplicate unit "stringhashlist" in "LCLBase 2.0.10", ppu="C:\Lazarus\lcl\units\x86_64-win64\stringhashlist.ppu", source="C:\Lazarus\lcl\stringhashlist.pas"

etc

Which one should be removed?. Lazutils has 2020 dated files.




Bazza

Lazarus 2.0.10; FPC 3.2.0; SVN Revision 63526; x86_64-win64-win32/win64
Windows 10.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Upgrade Lazarus, nothing compiles
« Reply #5 on: September 29, 2020, 10:24:32 am »
Curiously, I have no duplication between LazUtils and LCLBase directories. The former looks like the source and the latter the compiled version. I have no *.ppu files in the former, only the latter.

Bazzao

  • Full Member
  • ***
  • Posts: 178
  • Pies are squared.
Re: Upgrade Lazarus, nothing compiles
« Reply #6 on: September 29, 2020, 10:45:22 am »
trev,

You had hard coded paths, whilst mine contained undocumented variables - that may be the reason.

Occasionally an external unit has recompiled during compilation of my projects.

Looks like it is a file compare of .pas, .pp & .ppu. More chances to stuff things up.

Looks like it is best to remove Lazarus before upgrade.

Thanks for your help.

Bazza

Lazarus 2.0.10; FPC 3.2.0; SVN Revision 63526; x86_64-win64-win32/win64
Windows 10.

Bazzao

  • Full Member
  • ***
  • Posts: 178
  • Pies are squared.
Re: Upgrade Lazarus, nothing compiles
« Reply #7 on: September 29, 2020, 11:08:14 am »
Easy using "Search Everything".

I just added an extension of .was to offending files. Some were dated 2013 or 2015.
Bazza

Lazarus 2.0.10; FPC 3.2.0; SVN Revision 63526; x86_64-win64-win32/win64
Windows 10.

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: Upgrade Lazarus, nothing compiles
« Reply #8 on: September 29, 2020, 11:09:48 am »
You had hard coded paths, whilst mine contained undocumented variables - that may be the reason.
Just that you don't know $(FPCVER) does not mean that it is "undocumented": https://wiki.lazarus.freepascal.org/IDE_Macros_in_paths_and_filenames#Environment.

My Laz 2.0.10 installation has a hardcoded path only in "Tool" > "Options" > "Environment" > "Compiler executable". Macros are used in "FPC source directory" ($(LazarusDir)fpc\$(FPCVer)\source) and "Make executable" ($Path($(CompPath))\make.exe), and they perfectly make sense here. Note that the "Compiler" command in "Compiler Options" > "Compiler commands" of the project settings should be $(CompPath) -- otherwise you have a hard-to find issue when the compiler is not doing what you want.

With these settings you can easily switch between fpc versions by adjusting the "Compiler executable" only.

The duplicate units messages are probably due to the fact that some units were moved between packages between Laz 3.0.2 and 3.2.0, but you installed over the old Laz version. You can try to do a clean rebuild of the IDE which erases all ppu folders: "Tools" > "Configure "Build Lazarus"" > Check "Clean all" and "Switch after building to automatically" in the "Cleanup box". Then "Build". This may take some time, but it is definitely shorter than a complete new installation (which is another option, since installation of Lazarus on Windows is very easy).

For the next time when you do an "upgrade" I recommend a "secondary" installation, which leaves the old installation untouched. This way you have two (or more) Lazarus installations on your disk, and you can slowly check which features of the new version require changes in your projects. But keep in mind that the new IDE may introduce new properties in the lfm files which make it difficult to re-open that project in the old IDE. Always have a backup copy of your projects at hand when you work with different Lazarus/FPC versions. In order to create a "secondary" installation check this box in one of the first screens of the installer; define a directiory for your user settings (otherwise the settings will be mixed with those of the old IDE); do not register any file types with Windows.
« Last Edit: September 29, 2020, 11:15:16 am by wp »

Bazzao

  • Full Member
  • ***
  • Posts: 178
  • Pies are squared.
Re: Upgrade Lazarus, nothing compiles
« Reply #9 on: October 02, 2020, 12:49:37 am »
wp,

Thanks for the links. All is explained in lengthy way but gives no indication of how to obtain current values.

Look at it from my point of view, as a novice in some areas. I previously considered upgrading Lazarus and looked at comments about removing old versions. So I delayed. Then I came into the problem of creating a 32bit application for an XP-VM, so I needed that add-on. And that meant upgrading.

So I upgraded and found nothing would work. The project I was working on was not the only project. Every project was dead in the water until all the issues were resolved.

The two Options boxes are frustrating. Whilst there is help, it is laborious especially when time is short.

To cut the discussion short. A feature in the IDE would be that wherever there are options that accept macros is have 2 additional user boxes and a button. The user can copy a macro-item from an option and paste it into the first box, press a button to decode the macro and present the user with a result in the second box.

Eg you paste:
lib\$(TargetCPU)-$(TargetOS)
and it returns with
lib\Blah-Blah
in the following box.

I would like to see the above implemented in the next release of Lazarus. It would not take too much to include.

An alternative would be to grab all options that allow a macro, whether it is used or not, and list them in a text box in the following format:
* Prompt
* Current text
* Decoded text
* (blank line)
etc

One replyer showed he hard coded his options. Perhaps he too was frustrated. I wonder how many users hard-code their options.

Anyway I am killing off the now corrupted Lazarus, and restarting with the new version. This I cannot start for a few days.

I say to all uninstall before upgrade.
Bazza

Lazarus 2.0.10; FPC 3.2.0; SVN Revision 63526; x86_64-win64-win32/win64
Windows 10.

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: Upgrade Lazarus, nothing compiles
« Reply #10 on: October 02, 2020, 03:42:10 am »
What did you upgrade it from, and what method did you use to upgrade it?
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

 

TinyPortal © 2005-2018