aarch64-linux: Identifier not found "TPopupMenu" lazarus / 31-LCL ---------------------------------------------------------------------- Fred vS · 2020-12-26 13:11 Hello. I did install aarch64 fpc 3.2.0 and 3.3.1 trunk on a Raspberry 3 with Raspbian OS aarch64 64 bit. OK, nice, installer of fpc 3.2.0 did work and compilation + install of fpc 3.3.1 too. I can compile + run console, fpGUI and MSEgui applications. Note that on the Rpi 3 with aarch64 64 bit OS, all applications + system run much slower than with the arm 32 bit OS . But this is not the question. Now trying to compile a LCL application (LazPaint), with fp 3.2.0 and 3.3.1 I have a compilation error at controls.pp     Quote/home/pi/lazarus/lcl/controls.pp(1186,17) Error: (5000) Identifier not found "TPopupMenu"     /home/pi/lazarus/lcl/controls.pp(1186,27) Error: (5007) Error in type definition     /home/pi/lazarus/lcl/controls.pp(1267,45) Error: (5000) Identifier not found "TPopupMenu"     /home/pi/lazarus/lcl/controls.pp(1454,38) Error: (5000) Identifier not found "TPopupMenu"     /home/pi/lazarus/lcl/controls.pp(1731,36) Error: (5000) Identifier not found "TPopupmenu"     /home/pi/lazarus/lcl/controls.pp(2791,1) Fatal: (10026) There were 5 errors compiling module, stopping     Fatal: (1018) Compilation aborted     Error: /usr/bin/ppca64 returned an error exitcode I did try with Lazarus source 2.0.10 and trunk too but same error. I really dont understand why because I checked code of controls.pp and in uses section "menus" is present and in menus.pp TPopupMenu is declared. Do you have a idea why Identifier not found "TPopupMenu" ? Thanks. Fre;D ---------------------------------------------------------------------- jamie · 2020-12-26 13:46 Does the IDE itself build ok ? ---------------------------------------------------------------------- Fred vS · 2020-12-26 13:54 Quote from: jamie on December 26, 2020, 02:46:32 pmDoes the IDE itself build ok ? Hello Jamie. I did not try (because I was not able to build Lazarus on the Raspbian 32 OS too). To build LazPaint on Raspbian 32 bit, I use a command line and it works perfectly. So I try the same on Raspbian 64 bit but there is that Identifier not found "TPopupMenu" Fre;D [EDIT] Here the command line: Quotefpc -olazpaint -Fu./buttons -Fi./buttons -Fl./buttons -Fo./buttons -Fu./image -Fi./image -Fl./image -Fo./image -Fu./tools -Fi./tools -Fl./tools -Fo./tools -Fu../resources -Fi../resources -Fl../resources -Fo../resources -Fu./dialog -Fi./dialog -Fl./dialog -Fo./dialog -Fu./tablet -Fi./tablet -Fl./tablet -Fo./tablet -Fu./dialog/color -Fi./dialog/color -Fl./dialog/color -Fo./dialog/color -Fu./dialog/filter -Fi./dialog/filter -Fl./dialog/filter -Fo./dialog/filter -Fu./* -Fi./* -Fl./* -Fo./* -Fu../lazpaintcontrols -Fi../lazpaintcontrols -Fl../lazpaintcontrols -Fo../lazpaintcontrols -Fu/home/pi/bgrabitmap-master/bgrabitmap -Fi/home/pi/bgrabitmap-master/bgrabitmap -Fl/home/pi/bgrabitmap- master/bgrabitmap -Fo/home/pi/bgrabitmap-master/bgrabitmap -Fu/home/pi/bgrabitmap-master -Fi/home/pi/bgrabitmap-master -Fl/home/pi/bgrabitmap-master -Fo/home/pi/bgrabitmap-master -Fu/home/pi/lazarus/2.0.10/* -Fi/home/pi/lazarus/2.0.10/* -Fl/home/pi/lazarus/2.0.10/* -Fo/home/pi/lazarus/2.0.10/* -Fu/home/pi/lazarus/2.0.10/components/printers/unix -Fi/home/pi/lazarus/2.0.10/components/printers/unix -Fl/home/pi/lazarus/2.0.10/components/printers/unix -Fo/home/pi/lazarus/2.0.10/components/printers/unix -Fu/home/pi/lazarus/2.0.10/packager/registration -Fi/home/pi/lazarus/2.0.10/packager/registration -Fl/home/pi/lazarus/2.0.10/packager/registration -Fo/home/pi/lazarus/2.0.10/packager/registration -Fu/home/pi/lazarus/2.0.10/components/* -Fi/home/pi/lazarus/2.0.10/components/* -Fl/home/pi/lazarus/2.0.10/components/* -Fo/home/pi/lazarus/2.0.10/components/* -Fu/home/pi/bgracontrols- master -Fi/home/pi/bgracontrols-master -Fl/home/pi/bgracontrols-master -Fo/home/pi/bgracontrols-master -Fu/home/pi/lazarus/2.0.10/lcl/forms -Fi/home/pi/lazarus/2.0.10/lcl/forms -Fl/home/pi/lazarus/2.0.10/lcl/forms -Fo/home/pi/lazarus/2.0.10/lcl/forms -Fu/home/pi/lazarus/2.0.10/lcl/widgetset -Fi/home/pi/lazarus/2.0.10/lcl/widgetset -Fl/home/pi/lazarus/2.0.10/lcl/widgetset -Fo/home/pi/lazarus/2.0.10/lcl/widgetset -Fu/home/pi/lazarus/2.0.10/interfaces/* -Fi/home/pi/lazarus/2.0.10/interfaces/* -Fl/home/pi/lazarus/2.0.10/interfaces/* -Fo/home/pi/lazarus/2.0.10/interfaces/* -Fu/home/pi/lazarus/2.0.10/lcl/nonwin32 -Fi/home/pi/lazarus/2.0.10/lcl/nonwin32 -Fl/home/pi/lazarus/2.0.10/lcl/nonwin32 -Fo/home/pi/lazarus/2.0.10/lcl/nonwin32 -Fu/home/pi/lazarus/2.0.10/lcl/interfaces/gtk2 -Fi/home/pi/lazarus/2.0.10/lcl/interfaces/gtk2 -Fl/home/pi/lazarus/2.0.10/lcl/interfaces/gtk2 -Fo/home/pi/lazarus/2.0.10/lcl/interfaces/gtk2 -Fu/home/pi/lazarus/2.0.10/lcl/components/* -Fi/home/pi/lazarus/2.0.10/lcl/components/* -Fl/home/pi/lazarus/2.0.10/lcl/components/* -Fo/home/pi/lazarus/2.0.10/lcl/components/* -Fu/home/pi/lazarus/2.0.10/lcl/include -Fi/home/pi/lazarus/2.0.10/lcl/include -Fl/home/pi/lazarus/2.0.10/lcl/include -Fo/home/pi/lazarus/2.0.10/lcl/include -Fu/home/pi/lazarus/2.0.10/lcl -Fi/home/pi/lazarus/2.0.10/lcl -Fl/home/pi/lazarus/2.0.10/lcl -Fo/home/pi/lazarus/2.0.10/lcl  -MObjFPC -Scgi -Cg -OoREGVAR -Xs -XX -l -vewnhibq -B -O2 -XX -CX -Xs -vi -FUunits/ -dLCL -dLCLgtk2 lazpaint.lpr ---------------------------------------------------------------------- jamie · 2020-12-26 14:04 well if the IDE can't build then something is wrong obviously ! Have you tried doing this via sudo ? that will raise your permissions, maybe that will work since you can get it to work command line. ---------------------------------------------------------------------- Fred vS · 2020-12-26 14:14 Quote> well if the IDE can't build then something is wrong obviously ! Yes, sure, but I dont really need to install Lazarus at the moment on the Rpi. I do all the job on my laptop and only use the source to compile on the Rpi with a command line (see the [EDIT] of my previous post). Quote> Have you tried doing this via sudo ? I just tried now but sadly, same error. ---------------------------------------------------------------------- Fred vS · 2020-12-26 14:23 Here picture of LazPaint compiled and run on a Rpi-3 Raspbian arm 32 bit using the command line: And screenshot of a MSEgui app compiled and run on Rpi-3 Raspbian aarch64 64 bit: ---------------------------------------------------------------------- jamie · 2020-12-26 17:22 maybe you need to do a  CLEAN and BUILD ALL... it could be that not all of the units are actually compiled to their object state and the current compiler settings is not doing the compile of the lib units on the fly.. ---------------------------------------------------------------------- Fred vS · 2020-12-26 17:57 Quote from: jamie on December 26, 2020, 06:22:13 pmmaybe you need to do a  CLEAN and BUILD ALL... it could be that not all of the units are actually compiled to their object state and the current compiler settings is not doing the compile of the lib units on the fly.. Hello Jamie. Yes, of course, before each build, I remove manually all the files in /units (to be sure) and use the -B parameter. But how is it possible that controls.pp does not find a Identifier  ("TPopupMenu") if the identifier was declared in menus.pp unit (that is in the uses section). I dont know well LCL, but maybe TPopupMenu is inherited from GTK2 widget? Very strange. ---------------------------------------------------------------------- Fred vS · 2020-12-26 20:27 Quote from: jamie on December 26, 2020, 06:22:13 pmmaybe you need to do a  CLEAN and BUILD ALL... OK, I did try to first compile Lazarus IDE with: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ make clean all But there is exactly the same error as LazPaint: Quote/home/pi/lazarus/lcl/controls.pp(1186,17) Error: (5000) Identifier not found "TPopupMenu"     /home/pi/lazarus/lcl/controls.pp(1186,27) Error: (5007) Error in type definition     /home/pi/lazarus/lcl/controls.pp(1267,45) Error: (5000) Identifier not found "TPopupMenu"     /home/pi/lazarus/lcl/controls.pp(1454,38) Error: (5000) Identifier not found "TPopupMenu"     /home/pi/lazarus/lcl/controls.pp(1731,36) Error: (5000) Identifier not found "TPopupmenu"     /home/pi/lazarus/lcl/controls.pp(2791,1) Fatal: (10026) There were 5 errors compiling module, stopping     Fatal: (1018) Compilation aborted     Error: /usr/bin/ppca64 returned an error exitcode ---------------------------------------------------------------------- howardpc · 2020-12-26 20:33 It is possible that this is caused by the identically named menus.pp in both Lazarus/LCL and Free Pascal packages. FPC has a FreeVision package in a directory called fv which provides a menus.ppu for use in FreeVision apps. Lazarus as it gets compiled produces a menus.ppu based on its menus.pp, where TPopupMenu is declared. Perhaps the compiler first finds the fv menus.ppu which has no TPopupMenu declaration and then gives up? ---------------------------------------------------------------------- Fred vS · 2020-12-26 20:47 Quote from: howardpc on December 26, 2020, 09:33:51 pmIt is possible that this is caused by the identically named menus.pp in both Lazarus/LCL and Free Pascal packages. FPC has a FreeVision package in a directory called fv which provides a menus.ppu for use in FreeVision apps. Lazarus as it gets compiled produces a menus.ppu based on its menus.pp, where TPopupMenu is declared. Perhaps the compiler first finds the fv menus.ppu which has no TPopupMenu declaration and then gives up? Hello Howardpc. Hum, maybe but why the compilation with same code is oK on arm 32 bit and not with aarch64 64 bit? Could it be that some signal are not ok with fpc aarch64-linux? Does somebody have success to build Lazarus or a LCL application on a aarch64-linux machine (like a rpi3)? ---------------------------------------------------------------------- Fred vS · 2020-12-26 21:00 Quote from: howardpc on December 26, 2020, 09:33:51 pmIt is possible that this is caused by the identically named menus.pp in both Lazarus/LCL and Free Pascal packages. FPC has a FreeVision package in a directory called fv which provides a menus.ppu for use in FreeVision apps. Lazarus as it gets compiled produces a menus.ppu based on its menus.pp, where TPopupMenu is declared. Perhaps the compiler first finds the fv menus.ppu which has no TPopupMenu declaration and then gives up? OK, I did try this: remove /usr/lib/fpc/3.2.0/units/aarch64-linux/fv directory but still have the same error. ---------------------------------------------------------------------- Fred vS · 2020-12-27 00:05 Yeeep I get it  The trick was to place "Menus" unit as first place in uses section of /lcl/controls.pp: Here original code that makes problems: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  Classes, SysUtils, TypInfo, Types, Laz_AVL_Tree,  // LCL  LCLStrConsts, LCLType, LCLProc, GraphType, Graphics, LMessages, LCLIntf,  InterfaceBase, ImgList, PropertyStorage, Menus, ActnList, LCLClasses,  LResources, LCLPlatformDef,  // LazUtils  LazMethodList, LazLoggerBase, LazUtilities, UITypes; And here fixed code that makes all ok (see Menus as first position): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses Menus, Classes, SysUtils, TypInfo, Types, Laz_AVL_Tree,  // LCL  LCLStrConsts, LCLType, LCLProc, GraphType, Graphics, LMessages, LCLIntf,  InterfaceBase, ImgList, PropertyStorage, ActnList, LCLClasses,  LResources, LCLPlatformDef,  // LazUtils  LazMethodList, LazLoggerBase, LazUtilities, UITypes; ---------------------------------------------------------------------- Fred vS · 2020-12-27 00:43 Sorry, it is still me. To be complete, first change code like previous post and, like howardpc noted, remove usr/lib/fpc/3.2.0/units/aarch64-linux/fv directory (it makes conflict). Voila, I let you in peace. Fre;D ---------------------------------------------------------------------- PascalDragon · 2020-12-27 09:15 The removal of the fv directory should be enough. You probably didn't succeed at first, because it wasn't recompiled correctly. ---------------------------------------------------------------------- Thaddy · 2020-12-27 10:07 the "but that's not the question"part is because of VC6 support is not there in that test release.Once that is there things will improve. I have good results with terminal applications, they can be much faster. ---------------------------------------------------------------------- howardpc · 2020-12-27 10:33 @Thaddy Is your reply to some other thread? ---------------------------------------------------------------------- Thaddy · 2020-12-27 10:53 No, I replied the side note [qoute]Note that on the Rpi 3 with aarch64 64 bit OS, all applications + system run much slower than with the arm 32 bit OS . But this is not the question.[/quote] ---------------------------------------------------------------------- Fred vS · 2020-12-27 16:41 Quote from: PascalDragon on December 27, 2020, 10:15:58 amThe removal of the fv directory should be enough. You probably didn't succeed at first, because it wasn't recompiled correctly. Hello Sven. Yes, you are right, I re-used original code of controls.pp + remove fv directory and it compiles ok now. Quotethe "but that's not the question"part is because of VC6 support is not there in that test release.Once that is there things will improve. I have good results with terminal applications, they can be much faster. Hello Thaddy. Ha ok, I will wait then (but maybe with the Rpi3 with only 1 giga of ram, better to use the 32 bit OS. And use a Rpi4 with 4 Gigas ram for the 64 bit OS). @Howardpc: Well seen! Fre;D