typshrdh.inc lazarus / 64-FPC development ---------------------------------------------------------------------- dryzone · 2025-03-12 03:53 I only ask here in the developers section, as there is absolutely nothing available online about where to get this file. It is needed as an include in the "types" unit, which I am trying to use. Maybe it was left out during packaging ? Here is the compiler output. QuoteFree Pascal Compiler version 3.2.2 [2021/05/16] for i386 Copyright (c) 1993-2021 by Florian Klaempfl and others Target OS: Linux for i386 Compiling test_fileio.pas Compiling regexpr.pas Compiling types.pp types.pp(101,4) Fatal: Cannot open include file "typshrdh.inc" Fatal: Compilation aborted So where can I get a copy of "typshrdh.inc" ?? I installed and reinstalled from source and binaries, but this include is nowhere in the sources or binary trees. Apparantly, it needs to be in run-time rtl folder of the distribution, but it is no-show for all free pascal versions I installed to try and find it. Anyone can send me the file ? and more importantly explain what I did wrong during installation that could have excluded this file. ---------------------------------------------------------------------- TRon · 2025-03-12 04:03 The file is part of the RTL. Install in user space (with user rights, not admin). ---------------------------------------------------------------------- dbannon · 2025-03-12 04:19 In my case, it exists in each and every FPC install on my system - Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i dbannon@dell:~$ find / -iname "typshrdh.inc" 2>/dev/null/home/dbannon/bin/FPC/SRC/source-release_3_2_4- branch/rtl/inc/typshrdh.inc/home/dbannon/bin/FPC/SRC/source-fixes_3_2/ rtl/inc/typshrdh.inc/home/dbannon/bin/FPC/SRC/fpc- 3.2.0/rtl/inc/typshrdh.inc/home/dbannon/bin/FPC/SRC/fpc- 3.2.2/rtl/inc/typshrdh.inc/home/dbannon/bin/FPC/fpc-source/rtl/inc/typ shrdh.inc/home/dbannon/Pico2/fpcsrc/rtl/inc/typshrdh.inc/home/dbannon/ Pico/fpcsrc/rtl/inc/typshrdh.inc Note, its in the SRC directories, not with the binaries. Its used when the source is compiled and if the source needs recompiling. But if you have a binary only install of FPC, the assumption is made that you won't be rebuilding those binaries. Davo ---------------------------------------------------------------------- dryzone · 2025-03-12 05:30 Thank you for your response It is in none of the versions I have installed except in 3.2.2, but then only in the  sources. I found a copy in the /usr/share/fpcsrc directory as you suggested. So I copied "typshrd.inc" to the same directory where my program resides, as the compiler obviously is not configured to look in the sources directory. The compiler still cannot find "typshrd.inc" even if it is in the same directory as types.pp which calls it or in the same directory of the program. curious !! QuoteFree Pascal Compiler version 3.2.2 [2021/05/16] for i386 Copyright (c) 1993-2021 by Florian Klaempfl and others Target OS: Linux for i386 Compiling test_fileio.pas Compiling regexpr.pas Compiling types.pp types.pp(359,4) Fatal: Cannot open include file "typshrd.inc" Fatal: Compilation aborted ---------------------------------------------------------------------- TRon · 2025-03-12 05:49 Not that it has anything to do with current issue, typshrdh.inc is part of the RTL and should not be used/compiled separately. ---------------------------------------------------------------------- ccrause · 2025-03-12 05:58 The types unit is part of the RTL, so there should be no need to recompile anything (to use the types unit) if your FPC installation is properly configured. ---------------------------------------------------------------------- dryzone · 2025-03-12 06:24 Quote from: TRon on March 12, 2025, 06:49:41 amNot that it has anything to do with current issue, typshrdh.inc is part of the RTL and should not be used/compiled separately. I copied both types.ppu and  typshrdh.inc to rtl directory of 3.2.2. Still the same problem. fpc compiler is seemingly is unable to find this specific file never mind what you do. If it can find "types" who calls it and you place the include in the exact same directory, it should be able to find it. So now in the 3.2.2 rtl directory you have Quote./lib/fpc/3.2.2/units/i386-linux/rtl/typshrd.inc ./lib/fpc/3.2.2/units/i386-linux/rtl/typshrdh.inc but still the compiler cannot find it. ---------------------------------------------------------------------- TRon · 2025-03-12 06:34 As explained by ccrause and myself. If FPC is installed and configured correctly there is no need to handle any of these files. Unfortunately current actions/path/directions/heading make matters even worse. Suggest to do a new re-install of the compiler. ---------------------------------------------------------------------- dryzone · 2025-03-12 16:08 I already installed about 5 times ! How many times do I have to install to get the same result ? Do you have a link to configuration as there was nothing in the  installation that mentions extensive configuration. I have been using fpc for about 20 years now and never had these kind of problems. ---------------------------------------------------------------------- marcov · 2025-03-12 17:26 Somewhere you have something (old .ppu or .inc or other source) that convinces the compiler to recompile unit types The reason that it thinks that, _IS_  _THE_ problem, not that that recompilation attempt fails. Remove everything, clean as much as you can, and then reinstall and try to recompile again. If that fails again, pass -va and post the log. Compiling with -Ur might also solve some problems (but introduce others as the compiler will be more reluctant to recompile) ---------------------------------------------------------------------- dryzone · 2025-03-12 23:42 @marcov    I appreciate your help, thanks. The result is exactly the same error using -Ur compiler switch than without it.  Attached the results of -va switch ---------------------------------------------------------------------- TRon · 2025-03-13 00:34 Quote from: dryzone on March 13, 2025, 12:42:54 amAttached the results of -va switch Thank you. Now, could you please do that again but without the types and regexpr unit sources located in your project directory ? As you said the root cause is that the compiler is unable to located regexpr unit but that does not show in the current posted -va log because it tries to compile the one in the project directory instead. PS: just to make sure, you are doing this on a 32-bit Linux ? ---------------------------------------------------------------------- dryzone · 2025-03-13 01:15 Removed types.pp, types.pas, and regexpr_compilers.inc in my program directory. There are no other includes (inc) remaining. ---------------------------------------------------------------------- TRon · 2025-03-13 01:29 Quote from: dryzone on March 13, 2025, 02:15:57 amRemoved types.pp, types.pas, and regexpr_compilers.inc Plot thickens, thank you. From the log can be seen that: - compiler loads the regexpr.ppu file from project directory - compiler loads the math.ppu file from project directory - compiler locates the regexpr.pas file from project directory - compiler tries to locate regexpr_compilers.inc file from project directory and (ultimately) fails Remove from project directory: - regexpr.ppu - math.ppu - regexpr.pas Then try compile test_fileio.pas project again with -va option and please post output again. Edit: ...and... I just realized it was probably easier to instruct to copy the test_fileio.pas into a new directory and compile from there with -va and post the output. Sorry about that. ---------------------------------------------------------------------- dryzone · 2025-03-13 01:55 No problem. I moved tets_fileio.pas to a new directory (only containing this file)  and compiled it again  with -va switch Now it compiled, but I have utterly no idea what caused it not to compile with all my other pascal files in the same directory.    From the debug it seems it might be the math unit. ---------------------------------------------------------------------- TRon · 2025-03-13 02:09 Quote from: dryzone on March 13, 2025, 02:55:41 amNow it compiled, but I have utterly no idea what caused it not to compile with all my other pascal files in the same directory. No problem. Ok, so issue is solved for you now ? Possible causes: - residue units from a previous (other version) FPC installation which the compiler picked up on - similar to the previous a fpc.cfg file that was picked up on (pointing directories to wrong locations) - a unit in your project named the same as one of the RTL units (that is a no-no). Note that FPC treats units/sources with different casing the same. - it is possible the compiler thinks/believes a unit has changed checksum and tries to recompile which can be a problem when the RTL is stored in a non-writable location (hence the suggestion to install the compiler in user-space and/or use the by marcov suggested -Ur switch). I myself have never seen that happen for RTL units (though the first time I encountered such an issue with a non RTL unit I switched to installing the compiler into user-space) Outside those, I have no idea. That is why it would have been very informative to see this happen in your output log so that there might have been a possibility to reproduce. ---------------------------------------------------------------------- dryzone · 2025-03-13 05:38 Thanks to Tron & Marcov who helped me get a solution to this problem. I have enough to work with now to find out what the reason for the problem is and what triggers the compiler this way. I will figure it out and report back what I find, Thanks a lot. ---------------------------------------------------------------------- TRon · 2025-03-13 06:58 You're most welcome dryzone. If this experience provided some insight on how to analyze the problem then great. If encountered again any additional information would be appreciated. However, I think (imho) that it would be more beneficial to harness an FPC installation against this kind of mishaps by installing in user space (as for instance any package manager installation from your distro will ruin your current setup) and using a forced Free Pascal configuration file (fpc.cfg) that is not located in any of the standard location it searches for (see documentation). The configuration file that FPC uses can be forced by using the command-line option -n to ignore loading the default configuration file (if any is in place) and the @ option to point the compiler to the forced configuration file (see also command-line options). To prevent having to type that each and every time something needs to be compiled that can be solved by using a link, script or shell alias. If that sounds too complicated then FPCUp(Deluxe) can do such a setup automatically and provides a small fpc shell script that can be used to invoke the stand-alone compiler (just don't use FPCUp(Deluxe) to install to the standard system directory locations as it defeats its purpose) 2 cents ---------------------------------------------------------------------- dryzone · 2025-03-13 15:39 Thank you for your recommendations. Installing in userspace is a no no for my circumstances. That means I have to install on every terminal and laptop and whatever that access the server by ssh. It is just not practical. Remember I am not a windows user, where server based applications are iffy at best, and user space installs are the norm. I never get trouble with Linux server applications and did  not get much using Unix before that. I am pretty sure that my problem is self inflicted, although in a very creative way,  and the problem encountered in the end has nothing to do with fpc or the installation.  Once I confirm my hunch I will report back.