On 21/09/2020 13.53, Jan Engelhardt wrote:
On Monday 2020-09-21 13:47, Carlos E. R. wrote:
Which is obviously incorrect, or it would build. Don't ask me what is the error, I use "Build" from inside Lazarus, or:
There is no -k-pie in your command line.
Well, my program doesn't need/use it. It appears to be a parameter (-pie) passed to the linker: -pie --pic-executable Create a position independent executable. This is currently only supported on ELF platforms. Position independent executables are similar to shared libraries in that they are relocated by the dynamic linker to the virtual address the OS chooses for them (which can vary between invocations). Like normal dynamically linked executables they can be executed and symbols defined in the executable cannot be overridden by shared libraries. I don't see how that can be related to not finding the graphics unit. Anyway, I activate it in my program: ... Info: (lazarus) Execute Title="Compile Project, Target: contarcorreo" Info: (lazarus) Working Directory="/home_aux/cer/bin/lazarus/mios/contarcorreo/" Info: (lazarus) Executable="/usr/bin/fpc" Info: (lazarus) Param[0]="-Tlinux" Info: (lazarus) Param[1]="-Px86_64" Info: (lazarus) Param[2]="-MObjFPC" Info: (lazarus) Param[3]="-Sgi" Info: (lazarus) Param[4]="-Cg" Info: (lazarus) Param[5]="-Cirot" Info: (lazarus) Param[6]="-Os1" Info: (lazarus) Param[7]="-g" Info: (lazarus) Param[8]="-gl" Info: (lazarus) Param[9]="-XX" Info: (lazarus) Param[10]="-k-pie" Info: (lazarus) Param[11]="-l" Info: (lazarus) Param[12]="-vewnhibq" Info: (lazarus) Param[13]="-Fu/home/cer/.lazarus/lib/RunTimeTypeInfoControls/lib/x86_64-linux/gtk2" Info: (lazarus) Param[14]="-Fu/home/cer/.lazarus/lib/IDEIntf/units/x86_64-linux/gtk2" Info: (lazarus) Param[15]="-Fu/home/cer/.lazarus/lib/LazControls/lib/x86_64-linux/gtk2" Info: (lazarus) Param[16]="-Fu/home/cer/.lazarus/lib/units/x86_64-linux/gtk2" Info: (lazarus) Param[17]="-Fu/home/cer/.lazarus/lib/LCLBase/units/x86_64-linux" Info: (lazarus) Param[18]="-Fu/home/cer/.lazarus/lib/LazUtils/lib/x86_64-linux" Info: (lazarus) Param[19]="-Fu/usr/lib64/lazarus/packager/units/x86_64-linux" Info: (lazarus) Param[20]="-Fu/home_aux/cer/bin/lazarus/mios/contarcorreo/" Info: (lazarus) Param[21]="-o/home_aux/cer/bin/lazarus/mios/contarcorreo/contarcorreo" Info: (lazarus) Param[22]="-dLCL" Info: (lazarus) Param[23]="-dLCLgtk2" Info: (lazarus) Param[24]="contarcorreo.lpr" Hint: (11030) Start of reading config file /etc/fpc.cfg Hint: (11031) End of reading config file /etc/fpc.cfg Note: (11046) DWARF debug information cannot be used with smart linking on this target, switching to static linking Free Pascal Compiler version 3.2.0 [2020/08/18] for x86_64 Copyright (c) 1993-2020 by Florian Klaempfl and others (1002) Target OS: Linux for x86-64 (3104) Compiling contarcorreo.lpr /home_aux/cer/bin/lazarus/mios/contarcorreo/contarcorreo.lpr(11,44) Hint: (5023) Unit "U_Caja" not used in contarcorreo (9022) Compiling resource /home_aux/cer/bin/lazarus/mios/contarcorreo/contarcorreo.or (9015) Linking /home_aux/cer/bin/lazarus/mios/contarcorreo/contarcorreo (1008) 20 lines compiled, 1.5 sec (1022) 3 hint(s) issued (1023) 1 note(s) issued cer@Telcontar:~/bin/lazarus/mios/contarcorreo> But it doesn't run: cer@Telcontar:~/bin/lazarus/mios/contarcorreo> ./contarcorreo ./contarcorreo: Symbol `__libc_start_main' causes overflow in R_X86_64_PC32 relocation Segmentation fault (core dumped) cer@Telcontar:~/bin/lazarus/mios/contarcorreo> I have never used that parameter, so I can't say. I did not design my program to use it. Still, I do not see the relationship to "bad.pas" not building - if that is the error you get, because you did not post it. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)