FPC 3.0.4 failed to compile HelloWorld lazarus / 61-Beginners ---------------------------------------------------------------------- OldPascal · 2019-01-18 20:24 Free pascal fpc 3.0.4 failed to compile hello world.   The code is written as: 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  program HelloWorld; begin  writeln('Hello Pascal World');end.   Compiled it (opensuse Leap 15) under the command: 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 fpc  -vut "%f" I've got the error message as follows: 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 fpc  -vut "HelloWorld.pas"  (in directory: /home/adam/projects/GeanyTest1)Configfile search: /home/adam/.fpc.cfgReading options from file /home/adam/.fpc.cfgPath "/home/adam/fpc-3.0.0/lib/fpc/3.0.4/units/x86_64-linux/" not foundPath "/home/adam/fpc-3.0.0/lib/fpc/3.0.4/units/x86_64-linux/*/" not foundPath "/home/adam/fpc-3.0.0/lib/fpc/3.0.4/units/x86_64-linux/rtl/" not foundPath "/home/adam/fpc-3.0.0/lib/fpc/3.0.4/units/x86_64-linux/httpd22/" not foundPath "/home/adam/.fppkg/lib/fpc/3.0.4/units/x86_64-linux/*/" not foundPath "/usr/lib64/gcc/x86_64-suse-linux/4.8/" not foundPath "/home/adam/fpc-3.0.0/lib/fpc/3.0.4/lib/x86_64-linux/" not foundFree Pascal Compiler version 3.0.4 [2018/05/13] for x86_64Copyright (c) 1993-2017 by Florian Klaempfl and othersPath "/usr/lib/fpc/3.0.4/units/x86_64-linux/rtl/" not foundSearching file /lib64/ld-linux-x86-64.so.2... foundPath "/usr/X11R6/lib64/" not foundPath "/usr/lib/x86_64-linux-gnu/" not foundCompiler: /usr/lib64/fpc/3.0.4/ppcx64Target OS: Linux for x86-64Using executable path: /usr/lib64/fpc/3.0.4/Using unit path: /usr/lib64/fpc/3.0.4/Using library path: /lib64/Using library path: /usr/lib64/Using library path: /usr/lib64/fpc/3.0.4/Using object path: /usr/lib64/fpc/3.0.4/Compiling HelloWorld.pasSearching file HelloWorld.pas... found(HELLOWORLD) Registering new unit SYSTEM(HELLOWORLD) Load from HELLOWORLD (implementation) unit SYSTEM(SYSTEM)   Loading unit SYSTEMUnitsearch: system.ppuSearching file system.ppu... not foundSearching file SYSTEM.PPU... not foundUnitsearch: system.ppSearching file system.pp... not foundSearching file SYSTEM.PP... not foundUnitsearch: system.pasSearching file system.pas... not foundSearching file SYSTEM.PAS... not foundUnitsearch: /usr/lib64/fpc/3.0.4/system.ppuSearching file /usr/lib64/fpc/3.0.4/system.ppu... not foundSearching file /usr/lib64/fpc/3.0.4/SYSTEM.PPU... not foundUnitsearch: /usr/lib64/fpc/3.0.4/system.ppSearching file /usr/lib64/fpc/3.0.4/system.pp... not foundSearching file /usr/lib64/fpc/3.0.4/SYSTEM.PP... not foundUnitsearch: /usr/lib64/fpc/3.0.4/system.pasSearching file /usr/lib64/fpc/3.0.4/system.pas... not foundSearching file /usr/lib64/fpc/3.0.4/SYSTEM.PAS... not foundUnitsearch: system.ppSearching file system.pp... not foundSearching file SYSTEM.PP... not foundUnitsearch: system.pasSearching file system.pas... not foundSearching file SYSTEM.PAS... not foundUnitsearch: /usr/lib64/fpc/3.0.4/system.ppSearching file /usr/lib64/fpc/3.0.4/system.pp... not foundSearching file /usr/lib64/fpc/3.0.4/SYSTEM.PP... not foundUnitsearch: /usr/lib64/fpc/3.0.4/system.pasSearching file /usr/lib64/fpc/3.0.4/system.pas... not foundSearching file /usr/lib64/fpc/3.0.4/SYSTEM.PAS... not foundFatal: Can't find unit system used by HelloWorldFatal: Compilation abortedError: /usr/bin/ppcx64 returned an error exitcodeCompilation failed.  I search the hard drive for file system.pas and I cannot find it.  My guess is that I need RTL library but I cannot find it either. Can someone please  enlighted me what I am doing wrong here.  My mind is getting foggy. ---------------------------------------------------------------------- marcov · 2019-01-18 20:58 If 3.0.4 was non-functional, we would have noticed after more than an year. It is also strange that you have ~/fpc-3.0.0 in your compiler output. Freepascal generally operates from precompiled sources which are installed together, search for system.ppu. Typical location  is $PREFIX/fpc/units/$FPCTARGET/* or $PREFIX/fpc/units/$FPCTARGET/rtl* with $PREFIX being the prefix of the FPC install, and $FPCTARGET automatically substituted with the target (i386-linux or x86_64-linux depending on 32/64-bit). Check the -Fu line in your fpc.cfg, it should point to the precompiled unit directory For more background info, check the old but fine buildfaq. ---------------------------------------------------------------------- lucamar · 2019-01-18 21:36 My guess is that your installation is misconfigured. In mine (i386-linux), p.e. the paths are: Code: [Select]Compiler:   /usr/lib/fpc/3.0.4/ppc386 Units:      /usr/lib/fpc/3.0.4/units/ system.ppu: /usr/lib/fpc/3.0.4/units/i386-linux/rtl/system.ppu so in yours it should be something like: Code: [Select]Compiler:   /usr/lib64/fpc/3.0.4/ppcx64 Units:      /usr/lib64/fpc/3.0.4/units/ system.ppu: /usr/lib64/fpc/3.0.4/units/x86_64-linux/rtl/system.ppu As marcov says, check your fpc.cfg and set it right. Note that unless you installed also the sources you'll not have any of the RTL .pas, .pp, .inc, etc. but you don't really need them. Your compiler is asking for them only because it can't find the already compiled units. ---------------------------------------------------------------------- OldPascal · 2019-01-19 17:31 Thanks for feedback.  I looked into fpc.cfg found in ./etc/ directory and modified accordingly by adding the following lines 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 # added by Adam to make compiler work.# adding seaarch path for other stuff-Fu/us r/lib64/fpc/3.0.4/ppcx64-Fu/usr/lib64/fpc/3.0.4/units/- Fu/usr/lib64/fpc/3.0.4/units/x86_64-linux/rtl/system.ppu  But when running compiler again, I get the same results.  My impression is that compiler is not reading that configuration file but something else.  Where I am doing wrong.  Note that directories are correct and system.ppu is there. ---------------------------------------------------------------------- OldPascal · 2019-01-19 17:47 Okay, I fixed it.   Turns out that I have a hidden fpc.cfg file in home/adam.   When compiler did the wild search, it found it first in that directory instead etc directory.  I renamed the hidden file .fpc.cfg into .oldfpc.cfg.   This hidden config file is for 3.0.0 version.   When I compiled hello world again, it compiled but with warning message : 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 /usr/bin/ld: warning: link.res contains output sections; did you forget -T? I though it is referring to a flag so I did fpc -T but it did not compile.  What is -T ? ---------------------------------------------------------------------- lucamar · 2019-01-19 18:35 You can ignore it. As far as I understand it, the compiler uses those sections in a not-quite-standard way and the linker doesn't like the looks of them, but nonetheless it works. Newer versions of the linker don't produce that warning.