Recent

Author Topic: typshrdh.inc  (Read 1026 times)

dryzone

  • Jr. Member
  • **
  • Posts: 50
typshrdh.inc
« on: March 12, 2025, 04:53:48 am »
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.
Quote
Free 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.
« Last Edit: March 12, 2025, 04:55:32 am by dryzone »

TRon

  • Hero Member
  • *****
  • Posts: 4365
Re: typshrdh.inc
« Reply #1 on: March 12, 2025, 05:03:23 am »
The file is part of the RTL.

Install in user space (with user rights, not admin).
Today is tomorrow's yesterday.

dbannon

  • Hero Member
  • *****
  • Posts: 3348
    • tomboy-ng, a rewrite of the classic Tomboy
Re: typshrdh.inc
« Reply #2 on: March 12, 2025, 05:19:22 am »
In my case, it exists in each and every FPC install on my system -

Code: Bash  [Select][+][-]
  1. dbannon@dell:~$ find / -iname "typshrdh.inc" 2>/dev/null
  2. /home/dbannon/bin/FPC/SRC/source-release_3_2_4-branch/rtl/inc/typshrdh.inc
  3. /home/dbannon/bin/FPC/SRC/source-fixes_3_2/rtl/inc/typshrdh.inc
  4. /home/dbannon/bin/FPC/SRC/fpc-3.2.0/rtl/inc/typshrdh.inc
  5. /home/dbannon/bin/FPC/SRC/fpc-3.2.2/rtl/inc/typshrdh.inc
  6. /home/dbannon/bin/FPC/fpc-source/rtl/inc/typshrdh.inc
  7. /home/dbannon/Pico2/fpcsrc/rtl/inc/typshrdh.inc
  8. /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
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

dryzone

  • Jr. Member
  • **
  • Posts: 50
Re: typshrdh.inc
« Reply #3 on: March 12, 2025, 06:30:53 am »
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 !!

Quote
Free 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

 
« Last Edit: March 12, 2025, 06:32:56 am by dryzone »

TRon

  • Hero Member
  • *****
  • Posts: 4365
Re: typshrdh.inc
« Reply #4 on: March 12, 2025, 06:49:41 am »
Not that it has anything to do with current issue, typshrdh.inc is part of the RTL and should not be used/compiled separately.
Today is tomorrow's yesterday.

ccrause

  • Hero Member
  • *****
  • Posts: 1015
Re: typshrdh.inc
« Reply #5 on: March 12, 2025, 06:58:35 am »
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

  • Jr. Member
  • **
  • Posts: 50
Re: typshrdh.inc
« Reply #6 on: March 12, 2025, 07:24:40 am »
Not 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.
« Last Edit: March 12, 2025, 07:32:22 am by dryzone »

TRon

  • Hero Member
  • *****
  • Posts: 4365
Re: typshrdh.inc
« Reply #7 on: March 12, 2025, 07:34:49 am »
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.
Today is tomorrow's yesterday.

dryzone

  • Jr. Member
  • **
  • Posts: 50
Re: typshrdh.inc
« Reply #8 on: March 12, 2025, 05:08:19 pm »
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

  • Administrator
  • Hero Member
  • *
  • Posts: 12195
  • FPC developer.
Re: typshrdh.inc
« Reply #9 on: March 12, 2025, 06:26:03 pm »
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)
« Last Edit: March 12, 2025, 08:47:06 pm by marcov »

dryzone

  • Jr. Member
  • **
  • Posts: 50
Re: typshrdh.inc
« Reply #10 on: March 13, 2025, 12:42:54 am »
@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
« Last Edit: March 13, 2025, 12:45:56 am by dryzone »

TRon

  • Hero Member
  • *****
  • Posts: 4365
Re: typshrdh.inc
« Reply #11 on: March 13, 2025, 01:34:04 am »
Attached 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 ?
« Last Edit: March 13, 2025, 01:37:25 am by TRon »
Today is tomorrow's yesterday.

dryzone

  • Jr. Member
  • **
  • Posts: 50
Re: typshrdh.inc
« Reply #12 on: March 13, 2025, 02:15:57 am »
Removed types.pp, types.pas, and regexpr_compilers.inc in my program directory.
There are no other includes (inc) remaining.
« Last Edit: March 13, 2025, 02:28:58 am by dryzone »

TRon

  • Hero Member
  • *****
  • Posts: 4365
Re: typshrdh.inc
« Reply #13 on: March 13, 2025, 02:29:27 am »
Removed 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.
« Last Edit: March 13, 2025, 02:41:49 am by TRon »
Today is tomorrow's yesterday.

dryzone

  • Jr. Member
  • **
  • Posts: 50
Re: typshrdh.inc
« Reply #14 on: March 13, 2025, 02:55:41 am »
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.
« Last Edit: March 13, 2025, 03:00:57 am by dryzone »

 

TinyPortal © 2005-2018