Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2025-01

Compile errors

11 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Frank McCormick

I have recently got back into working with Free Pascal. I ran across a CRT replacement called NCRT and OCRT and am getting compile errors which I can't track down. Are these units still workable with Free Pascal ?
These are the errors I am getting:

Free Pascal Compiler version 3.2.2 [2025/01/10] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling ncrt.pp
ncrt.inc(225,11) Error: Identifier not found "TermIOS"
ncrt.inc(225,18) Error: Error in type definition
ncrt.inc(278,4) Error: Identifier not found "tcGetAttr"
ncrt.inc(326,4) Error: Identifier not found "tcSetAttr"
ncrt.inc(326,20) Error: Identifier not found "TCSANOW"
ncrt.inc(744,3) Error: Illegal type conversion: "Text" to "TextRec"
ncrt.inc(835,3) Error: Identifier not found "Select"
ncrt.inc(971,4) Error: Illegal type conversion: "Text" to "TextRec"
ncrt.inc(975,4) Error: Illegal type conversion: "Text" to "TextRec"
ncrt.pp(39) Fatal: There were 9 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode

Can someone help ?

Thanks

Frank McCormick

Frank McCormick

I have been trying out a CRT replacement called NCRT and OCRT and am getting link errors which I can't track down. Originally I was getting compile errors but I sorted that out.
Are these units still workable with Free Pascal ?
These are the link errors I am getting:

Free Pascal Compiler version 3.2.2 [2025/01/10] for x86_64 Copyright (c) 1993-2021 by Florian Klaempfl and others Target OS: Linux for x86-64
Compiling screen_demo.pp
Linking screen_demo
/usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o: in function `NCURSES_$$_ACS_ULCORNER$$QWORD':
ncurses.pp:(.text.n_ncurses_$$_acs_ulcorner$$qword+0x3): undefined reference to `acs_map'
/usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o: in function `NCURSES_$$_ACS_LLCORNER$$QWORD':
ncurses.pp:(.text.n_ncurses_$$_acs_llcorner$$qword+0x3): undefined reference to `acs_map'
/usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o: in function `NCURSES_$$_ACS_URCORNER$$QWORD':
ncurses.pp:(.text.n_ncurses_$$_acs_urcorner$$qword+0x3): undefined reference to `acs_map'
/usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o: in function `NCURSES_$$_ACS_LRCORNER$$QWORD':
ncurses.pp:(.text.n_ncurses_$$_acs_lrcorner$$qword+0x3): undefined reference to `acs_map'
/usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o: in function `NCURSES_$$_ACS_LTEE$$QWORD':
ncurses.pp:(.text.n_ncurses_$$_acs_ltee$$qword+0x3): undefined reference to `acs_map'
/usr/bin/ld:
/usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o:ncurses.pp:(.text.n_ncurses_$$_acs_rtee$$qword+0x3): more undefined references to `acs_map' follow
/usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o: in function `NCURSES_$$_COLOR_SET$SMALLINT$POINTER$$LONGINT': ncurses.pp:(.text.n_ncurses_$$_color_set$smallint$pointer$$longint+0xe): undefined reference to `stdscr'
/usr/bin/ld:

Can someone help ?

Thanks

Frank McCormick

Michael Van Canneyt
to Frank McCormick
Frank McCormick wrote 39 lines
I have been trying out a CRT replacement called NCRT and OCRT and am getting link errors which I can't track down. Originally I was getting compile errors but I sorted that out. Are these units still workable with Free Pascal ? These are the link errors I am getting: Free Pascal Compiler version 3.2.2 [2025/01/10] for x86_64 Copyright (c) 1993-2021 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling screen_demo.pp Linking screen_demo /usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o: in function `NCURSES_$$_ACS_ULCORNER$$QWORD': ncurses.pp:(.text.n_ncurses_$$_acs_ulcorner$$qword+0x3): undefined reference to `acs_map' /usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o: in function `NCURSES_$$_ACS_LLCORNER$$QWORD': ncurses.pp:(.text.n_ncurses_$$_acs_llcorner$$qword+0x3): undefined reference to `acs_map' /usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o: in function `NCURSES_$$_ACS_URCORNER$$QWORD': ncurses.pp:(.text.n_ncurses_$$_acs_urcorner$$qword+0x3): undefined reference to `acs_map' /usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o: in function `NCURSES_$$_ACS_LRCORNER$$QWORD': ncurses.pp:(.text.n_ncurses_$$_acs_lrcorner$$qword+0x3): undefined reference to `acs_map' /usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o: in function `NCURSES_$$_ACS_LTEE$$QWORD': ncurses.pp:(.text.n_ncurses_$$_acs_ltee$$qword+0x3): undefined reference to `acs_map' /usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o:ncurses.pp:(.text.n_ncurses_$$_acs_rtee$$qword+0x3): more undefined references to `acs_map' follow /usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ncurses.o: in function `NCURSES_$$_COLOR_SET$SMALLINT$POINTER$$LONGINT': ncurses.pp:(.text.n_ncurses_$$_color_set$smallint$pointer$$longint+0xe): undefined reference to `stdscr' /usr/bin/ld:

Your answer may be here:

https://unix.stackexchange.com/questions/30526/undefined-reference-to-symbol-acs-map-when-running-makeconfig

So try to add

  {$linklib tinfo}

to your program source.

Michael.

Frank McCormick
to Michael Van Canneyt
Michael Van Canneyt wrote 19 lines
On Mon, 20 Jan 2025, Frank McCormick via fpc-pascal wrote: > I have been trying out a CRT replacement called NCRT and OCRT and > am getting link errors which I can't track down. Originally I was > getting compile errors but I sorted that out. > Are these units still workable with Free Pascal ? > These are the link errors I am getting: > > Free Pascal Compiler version 3.2.2 [2025/01/10] for x86_64 > Copyright (c) 1993-2021 by Florian Klaempfl and others > Target OS: Linux for x86-64 > Compiling screen_demo.pp > Linking screen_demo > /usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ > ncurses.o: in function `NCURSES_$$_ACS_ULCORNER$$QWORD': > ncurses.pp:(.text.n_ncurses_$$_acs_ulcorner$$qword+0x3): undefined > reference to `acs_map'

/snip/

Show quoted text 9 lines
Your answer may be here: https://unix.stackexchange.com/questions/30526/undefined-reference-to- symbol-acs-map-when-running-makeconfig So try to add  {$linklib tinfo} to your program source.

I added it at the top of the source but
same problem(s). I also found out I cannot compile ANY of the example programs provided.
They all show linking errors similar to what I get with screen_demo.

I have ncurses (5 and 6) install along with the dev files. This is on OpenSuse Tumbleweed.

I am baffled at this point as I was planning on using ocrt and/or ncrt in some of the programs I am developing using crt at the moment.

Thanks
Frank McCormick

Michael Van Canneyt
to Frank McCormick
Frank McCormick wrote 43 lines
On 2025-01-21 09:00, Michael Van Canneyt via fpc-pascal wrote: > > > On Mon, 20 Jan 2025, Frank McCormick via fpc-pascal wrote: > >> I have been trying out a CRT replacement called NCRT and OCRT and >> am getting link errors which I can't track down. Originally I was >> getting compile errors but I sorted that out. >> Are these units still workable with Free Pascal ? >> These are the link errors I am getting: >> >> Free Pascal Compiler version 3.2.2 [2025/01/10] for x86_64 >> Copyright (c) 1993-2021 by Florian Klaempfl and others >> Target OS: Linux for x86-64 >> Compiling screen_demo.pp >> Linking screen_demo >> /usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ >> ncurses.o: in function `NCURSES_$$_ACS_ULCORNER$$QWORD': >> ncurses.pp:(.text.n_ncurses_$$_acs_ulcorner$$qword+0x3): undefined >> reference to `acs_map' /snip/ > > Your answer may be here: > > https://unix.stackexchange.com/questions/30526/undefined-reference-to- > symbol-acs-map-when-running-makeconfig > > So try to add >  {$linklib tinfo} > to your program source. I added it at the top of the source but same problem(s). I also found out I cannot compile ANY of the example programs provided. They all show linking errors similar to what I get with screen_demo. I have ncurses (5 and 6) install along with the dev files. This is on OpenSuse Tumbleweed. I am baffled at this point as I was planning on using ocrt and/or ncrt in some of the programs I am developing using crt at the moment.

Strange. I know someone who uses ocrt on OpenSuse since years. Maybe he is still on an older version of OpenSuse.

I now tested 10 of the provided demos and on my linux mint they all start without problem.

Michael.

Christo Crause
to Frank McCormick: I have recently got back into working with Free Pascal. I ran across a CRT replacement…

On Tue, Jan 21, 2025 at 2:34 PM Frank McCormick via fpc-pascal <

Show quoted text 8 lines
wrote: Free Pascal Compiler version 3.2.2 [2025/01/10] for x86_64 Copyright (c) 1993-2021 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling ncrt.pp ncrt.inc(225,11) Error: Identifier not found "TermIOS"

Are you using the ncurses package of FPC 3.2.2? The line number for the first error does not correspond to the location of the identifier. It should be on line 216:
https://gitlab.com/freepascal.org/fpc/source/-/blob/release_3_2_2/packages/ncurses/src/ncrt.inc?ref_type=tags#L216

Frank McCormick
to Christo Crause
Christo Crause wrote 16 lines
On Tue, Jan 21, 2025 at 2:34 PM Frank McCormick via fpc-pascal <fpc- > wrote: Free Pascal Compiler version 3.2.2 [2025/01/10] for x86_64 Copyright (c) 1993-2021 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling ncrt.pp ncrt.inc(225,11) Error: Identifier not found "TermIOS" Are you using the ncurses package of FPC 3.2.2?  The line number for the first error does not correspond to the location of the identifier. It should be on line 216: https://gitlab.com/freepascal.org/fpc/ source/-/blob/release_3_2_2/packages/ncurses/src/ncrt.inc? ref_type=tags#L216 <https://gitlab.com/freepascal.org/fpc/source/-/blob/ release_3_2_2/packages/ncurses/src/ncrt.inc?ref_type=tags#L216>

I guess you are reponding to the first message I posted to the list yesterday when I was trying to compile the ncrt package I had downloaded from the net. That was BEFORE I realized the whole ncurses package was part of FPC.
Since then the screen_demo compiles but I get dozens of errors in the linking. This was the second message I posted yesterday.

Frank McCormick

Christo Crause
to Frank McCormick

On Tue, 21 Jan 2025, 19:24 Frank McCormick via fpc-pascal, <

Show quoted text 7 lines
wrote: I guess you are reponding to the first message I posted to the list yesterday when I was trying to compile the ncrt package I had downloaded from the net. That was BEFORE I realized the whole ncurses package was part of FPC.

My apologies, I somehow missed the later messages.

Frank McCormick
to Michael Van Canneyt: Strange. I know someone who uses ocrt on OpenSuse since years. Maybe he is still on an…
Michael Van Canneyt wrote 48 lines
On Tue, 21 Jan 2025, Frank McCormick via fpc-pascal wrote: > > > On 2025-01-21 09:00, Michael Van Canneyt via fpc-pascal wrote: >> >> >> On Mon, 20 Jan 2025, Frank McCormick via fpc-pascal wrote: >> >>> I have been trying out a CRT replacement called NCRT and OCRT and >>> am getting link errors which I can't track down. Originally I was >>> getting compile errors but I sorted that out. >>> Are these units still workable with Free Pascal ? >>> These are the link errors I am getting: >>> >>> Free Pascal Compiler version 3.2.2 [2025/01/10] for x86_64 >>> Copyright (c) 1993-2021 by Florian Klaempfl and others >>> Target OS: Linux for x86-64 >>> Compiling screen_demo.pp >>> Linking screen_demo >>> /usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ >>> ncurses.o: in function `NCURSES_$$_ACS_ULCORNER$$QWORD': >>> ncurses.pp:(.text.n_ncurses_$$_acs_ulcorner$$qword+0x3): undefined >>> reference to `acs_map' > /snip/ >> >> Your answer may be here: >> >> https://unix.stackexchange.com/questions/30526/undefined-reference- >> to- symbol-acs-map-when-running-makeconfig >> >> So try to add >>   {$linklib tinfo} >> to your program source. > > I added it at the top of the source but > same problem(s). I also found out I cannot compile ANY of the example > programs provided. Strange. I know someone who uses ocrt on OpenSuse since years. Maybe he is still on an older version of OpenSuse. I now tested 10 of the provided demos and on my linux mint they all start without problem.

This is weird. This morning I installed FPC into my Debian Trixie installation on another partition.
I successfully compiled and ran all the demo programs !!

It seems FPC on my OpenSuse installation is broken somehow. I have removed FPC and installed it directly from the RPM downloads on the Free Pascal site and it suffered the same problems. I then re-installed the OpenSuse Tumbleweed version and suffered exactly the same problem.
I will try asking on the OpenSuse Tumbleweed mailing list, but I fear there are not many (if any) people using Pascal there.

Frank McCormick.

Michael Van Canneyt
to Frank McCormick
Frank McCormick wrote 19 lines
> > Strange. I know someone who uses ocrt on OpenSuse since years. Maybe he > is still on an older version of OpenSuse. > > I now tested 10 of the provided demos and on my linux mint they all start > without problem. > This is weird. This morning I installed FPC into my Debian Trixie installation on another partition. I successfully compiled and ran all the demo programs !! It seems FPC on my OpenSuse installation is broken somehow. I have removed FPC and installed it directly from the RPM downloads on the Free Pascal site and it suffered the same problems. I then re-installed the OpenSuse Tumbleweed version and suffered exactly the same problem. I will try asking on the OpenSuse Tumbleweed mailing list, but I fear there are not many (if any) people using Pascal there.

The problem is a mismatch between the fpc import units and the libraries installed. A fpc import unit such as ncurses (ocrt,ncrt) describes all the functions and types in a library. It follows that if the library no longer offers these functions, the unit is no longer correct and linking will fail (as you observed).

The conclusion is that opensuse ships different ncurses libraries than debian, and the fpc units describe the units as found on debian. Up till a certain version of opensuse they were probably identical (because I know someone who has been using it for almost 20 years on OpenSuSE), but now they differ.

It may be that the functions previously found in the ncurses library are now simply in another library, the question then becomes 'which one ?'

Michael.

Frank McCormick
to Michael Van Canneyt
Michael Van Canneyt wrote 7 lines
> > It seems FPC on my OpenSuse installation is broken somehow. > I have removed FPC and installed it directly from the RPM downloads > on the Free Pascal site and it suffered the same problems. > I then re-installed the OpenSuse Tumbleweed version
Show quoted text 9 lines
The problem is a mismatch between the fpc import units and the libraries installed. A fpc import unit such as ncurses (ocrt,ncrt) describes all the functions and types in a library. It follows that if the library no longer offers these functions, the unit is no longer correct and linking will fail (as you observed). The conclusion is that opensuse ships different ncurses libraries than debian, and the fpc units describe the units as found on debian. Up till a certain version

An OpenSuse user seems to have found the solution. Here is what Jan Engelhardt found.

ncurses6 ABI has _nc_ prefixes $ nm -CD /usr/lib64/libtinfo.so.6 | grep stdscr 000000000000ff20 T _nc_stdscr

I am in the process of changing the source on my system. We'll see what happens.

Frank McCormick