Problems with Tumbleweed libncurses

I have been experiencing troubles with Free Pascal compiling programs which use the ncurses unit supplied with FPC. It links with libncurses. As an example compiling the screen_demo program with comes with FPC. 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/ocrt.o: in function `OCRT_$$_SETACTIVEWN$PWINDOW': ocrt.pp:(.text.n_ocrt_$$_setactivewn$pwindow+0x4c): undefined reference to `stdscr' /usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ocrt.o: in function `OCRT_$$_STARTCURSES$PWINDOW$$BOOLEAN': ocrt.pp:(.text.n_ocrt_$$_startcurses$pwindow$$boolean+0x74): undefined reference to `stdscr' /usr/bin/ld: ocrt.pp:(.text.n_ocrt_$$_startcurses$pwindow$$boolean+0x86): undefined reference to `stdscr' /usr/bin/ld: ocrt.pp:(.text.n_ocrt_$$_startcurses$pwindow$$boolean+0x98): undefined reference to `stdscr' /usr/bin/ld: ocrt.pp:(.text.n_ocrt_$$_startcurses$pwindow$$boolean+0xac): undefined reference to `stdscr' I installed FPC on Debian Trixie in another partition and there are no such problems. The program compiles and runs flawlessly. Does anyone have any ideas what is the problem here. Apparently some functions the FPC unit calls are unavailable in the libncurses library on Tumbleweed ?? Some have suggested I link the tinfo library as some have discovered that resolves the program for them when compiling c and c++ programs. But it doesn't work in my case.

On Friday 2025-01-24 16:15, Frank McCormick wrote:
Linking screen_demo /usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ocrt.o: in function `OCRT_$$_SETACTIVEWN$PWINDOW': ocrt.pp:(.text.n_ocrt_$$_setactivewn$pwindow+0x4c): undefined reference to `stdscr'
I installed FPC... Does anyone have any ideas what is the problem here.
ncurses6 ABI has _nc_ prefixes $ nm -CD /usr/lib64/libtinfo.so.6 | grep stdscr 000000000000ff20 T _nc_stdscr

On 2025-01-24 13:44, Jan Engelhardt wrote:
On Friday 2025-01-24 16:15, Frank McCormick wrote:
Linking screen_demo /usr/bin/ld: /usr/lib64/fpc/3.2.2/units/x86_64-linux/ncurses/ocrt.o: in function `OCRT_$$_SETACTIVEWN$PWINDOW': ocrt.pp:(.text.n_ocrt_$$_setactivewn$pwindow+0x4c): undefined reference to `stdscr'
I installed FPC... Does anyone have any ideas what is the problem here.
ncurses6 ABI has _nc_ prefixes
$ nm -CD /usr/lib64/libtinfo.so.6 | grep stdscr 000000000000ff20 T _nc_stdscr
I have filed a bug report with FPC. I think it is unacceptable that ncurses doesn't work with OpenSuse libraries. Frank McCormick

According to this post: https://forums.opensuse.org/t/compiling-midnight-commander-what-does-provide... "libncurses6 is built with --enable-reentrant which changes some variable names, so stdscr becomes __nc_stdscr." I can use the workaround that post mentioned to build with libncurses5: fpc -I/usr/include/ncurses5/ncurses -k"-L/usr/lib64/ncurses5 -lncurses -ltinfo" screen_demo.pp As that post said, fpc should use proper includes. Additionally, the ncurses.pp of fpc has `NCURSES_VERSION = '5.6';` in it. Updating to newer ABI versions may be beneficial.
participants (3)
-
Frank McCormick
-
Jan Engelhardt
-
JS