Error while linking lazarus / 32-Linux ---------------------------------------------------------------------- ChPr · 2023-06-19 15:27 Hello everybody, I am working with Lazarus 2.0.6 and fpc 3.04 under Ubuntu 22.04.2 LTS. If I want to compile an existing program or a new program or to re- compile Lazarus to insert or modify a componant I always get the following error : 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 Error while linking NOTE 1 : the problem concerning crtbeginS.o has been solved elsewhere. NOTE 2 : Lazarus 2.0.6 and fpc 3.0.4 was working before and the only changes are updates of Ubuntu. May be from Ubuntu 20 ? Sincerely Pierre. ---------------------------------------------------------------------- marcov · 2023-06-19 15:36 That is a conclusion, not the actual error.  Maybe the actual error is filtered. Typically some shared library is not found. Right click on a line in the messages window, and play with the filtered options, and retry the compile ---------------------------------------------------------------------- ChPr · 2023-06-19 16:00 I removed all filters and I get this : 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 Messages - Conseils : 98...Création de l'EDI: Code de sortie 2 - Erreurs : 1 - Conseils : 4Debug: make: Entering directory '/usr/share/lazarus/2.0.6'Verbose: /usr/bin/make -C ide idepkgVerbose: make[1]: Entering directory '/usr/share/lazarus/2.0.6/ide'Verbose: /usr/bin/make --assume-new=lazarus.pp lazarus OPT=' "@/home/chp/.lazarus/idemake.cfg"'Verbose: make[2]: Entering directory '/usr/share/lazarus/2.0.6/ide'Verbose: /usr/bin/fpc -gl -vbqewnhi -Sci -dlclgtk2 -Fu../designer -Fu../debugger -Fu../debugger/frames -Fu../converter -Fu../packager -Fu../packager/frames -Fu../components/custom -Fuframes -Fu. -Fu/usr/lib/fpc/3.0.4/units/x86_64-linux/rtl -Fiinclude -Fiinclude/linux -Fi../images -FE.. -FU../units/x86_64-linux/gtk2 -Cg -Fl/usr/lib/gcc/x86_64-linux-gnu/11 -Flinclude -Fl/etc/ld.so.conf.d/*.conf "@/home/chp/.lazarus/idemake.cfg" -dx86_64 lazarus.ppHint: Start of reading config file /etc/fpc.cfgHint: End of reading config file /etc/fpc.cfgHint: Start of reading config file /home/chp/.lazarus/idemake.cfgHint: End of reading config file /home/chp/.lazarus/idemake.cfgVerbose: Free Pascal Compiler version 3.0.4 [2018/10/29] for x86_64Verbose: Copyright (c) 1993-2017 by Florian Klaempfl and othersVerbose: Target OS: Linux for x86-64Verbose: Compiling lazarus.ppVerbose: Compiling resource /home/chp/.lazarus/units/x86_64-linux/gtk2/lazarus.orVerbose: Linking /home/chp/.lazarus/bin/lazarusVerbose: linker: /usr/bin/ld: warning: /home/chp/.lazarus/bin/link.res contains output sections; did you forget -T?Verbose: linker: /usr/bin/ld: /usr/lib/fpc/3.0.4/units/x86_64-linux/rtl/cprt0.o: in function `_start':Debug: (.text+0x3c): undefined reference to `__libc_csu_init'Verbose: linker: /usr/bin/ld: (.text+0x43): undefined reference to `__libc_csu_fini'Verbose: [Makefile:4144: lazarus] Error 1Verbose: [Makefile:4574: idepkg] Error 2Debug: make: *** [Makefile:3385: idepkg] Error 2lazarus.pp(165,1) Error: Error while linkinglazarus.pp(165,1) Verbose: There were 1 errors compiling module, stoppingVerbose: Compilation abortedVerbose: /usr/bin/ppcx64 returned an error exitcodeVerbose: make[2]: Leaving directory '/usr/share/lazarus/2.0.6/ide'Verbose: make[1]: Leaving directory '/usr/share/lazarus/2.0.6/ide'Debug: make: Leaving directory '/usr/share/lazarus/2.0.6'  Sorry, I french and working with the franche version of Lazarus Sincerely. Pierre ---------------------------------------------------------------------- marcov · 2023-06-19 16:10 The problem is this: Code: [Select]Debug: (.text+0x3c): undefined reference to `__libc_csu_init' Verbose: linker: /usr/bin/ld: (.text+0x43): undefined reference to `__libc_csu_fini' This is a startup issue (like crt-begin). Somehow the installed startup code is not as expected. Probably something with the very old( pre 2020) FPC 3.0.4 version in combination with a very new (2022) distribution ? ---------------------------------------------------------------------- dbannon · 2023-06-20 08:13 You seem to be using a reasonably recent (and supported) OS but a quite old FPC/Lazarus. If the FPC/Lazarus is there from a previous install, so too might be your fpc.cfg file. Perhaps check that its path to gcc libs points to a valid dir - Code: [Select]#ifdef cpux86_64 -Fl/usr/lib/gcc/x86_64-linux-gnu/9 #endif Make sure the last part of that line exists (and contains stuff). In my case, U20.04, its '9'. U22.04 could be '10', '11' or '12', don't remember which. Davo ---------------------------------------------------------------------- Zvoni · 2023-06-20 09:14 This is another hint: '/usr/share/lazarus/2.0.6' That's an install from the Distro-Repo. I too used Ubuntu until 19.10 and did the mistake to install from repo. Only had problems with it (missing files, wrong paths etc.) ---------------------------------------------------------------------- ChPr · 2023-06-23 07:26 I came to the conclusion that my version of Lazarus/FPC would no longer work under Ubuntu 22.04.2 LTS. So I deleted it. I then looked for the latest version: Lazarus 2.2.6 and FPC 3.2.2 which I installed: and it works, compiles and runs  What's a pain is that each time you change version, you have to reinstall all the components you use, and for some (Indy, cups for example), it's not easy. But hey ... In any case, thank you for your information. Best regards. Pierre.