Code: Select all
cd /usr/local/src
sudo chmod 777 .
git clone https://github.com/wiedehopf/readsb.git
cd readsb
make
...
cc -o readsb readsb.o argp.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o json_out.o net_io.o crc.o demod_2400.o uat2esnt/uat2esnt.o uat2esnt/uat_decode.o stats.o cpr.o icao_filter.o track.o util.o fasthash.o convert.o sdr_ifile.o sdr_beast.o sdr.o ais_charset.o globe_index.o geomag.o receiver.o aircraft.o api.o minilzo.o threadpool.o -pthread -lpthread -lm -lrt -lzstd -lz -lncurses
/usr/libexec/gcc/x86_64-pc-linux-gnu/ld: interactive.o: undefined reference to symbol 'stdscr'
/usr/libexec/gcc/x86_64-pc-linux-gnu/ld: /lib64/libtinfo.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:158: readsb] Error 1
Code: Select all
The Standard Screen
Upon initializing curses, a default window called stdscr, which is the size of the terminal screen, is created. Many curses functions use this window.
Source: https://manpages.org/stdscr/3Code: Select all
jlpoole@ryzdesk /usr/local/src/readsb $ nm -gD /lib64/libncurses.so.6.4 |nl|grep stdscr
311 0000000000014af0 T _nc_stdscr_of
428 U stdscr
jlpoole@ryzdesk /usr/local/src/readsb $ I also tried building the project on Debian and I succeeded. So I compared the search for the symbol on both systems:
On the Rpi4:
Code: Select all
jlpoole@adsbDEV:/run/readsb $ nm -gD /usr/lib/arm-linux-gnueabihf/libncurses.so.6.2 |grep stdscr
U stdscr@NCURSES6_TINFO_5.0.19991023
jlpoole@adsbDEV:/run/readsb $ nm -gD /usr/lib/arm-linux-gnueabihf/libncurses.so.6 |grep stdscr
U stdscr@NCURSES6_TINFO_5.0.19991023
jlpoole@adsbDEV:/run/readsb $On Debian:
Code: Select all
jlpoole@debian1:~$ nm -gD /usr/lib/x86_64-linux-gnu/libncursesw.so.6.4 |grep stdscr
U stdscr@NCURSES6_TINFO_5.0.19991023
jlpoole@debian1:~$ As I searched around, I read somewhere that ncurses may be compiled into two libraries and after scouring my Gentoo system with:
Code: Select all
locate "*ncurs*"I discovered the tool "ncurses6-config" which I was not familiar with. I learned one of the options, i.e. "--libs", revealed a query which "echos the libraries needed to link with ncurses". The output below shows that "-ltinfo" was listed, so I tried adding at the end " -ltinfo" to the linker command of the failing command line and the linker successfully created the object file and the "make" continued. What was needed was to specify the inclusion of libraray "tinfo" (/lib64/libtinfo.so.6.4).
Code: Select all
jlpoole@ryzdesk /usr/local/src/readsb $ /usr/bin/ncurses6-config
Usage: ncurses6-config [options]
Options:
--prefix echos the package-prefix of ncurses
--exec-prefix echos the executable-prefix of ncurses
--cflags echos the C compiler flags needed to compile with ncurses
--libs echos the libraries needed to link with ncurses
...
jlpoole@ryzdesk /usr/local/src/readsb $ /usr/bin/ncurses6-config --libs
-L/usr/lib64 -lncurses -ltinfo
jlpoole@ryzdesk /usr/local/src/readsb $ cc -o readsb readsb.o argp.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o json_out.o net_io.o crc.o demod_2400.o uat2esnt/uat2esnt.o uat2esnt/uat_decode.o stats.o cpr.o icao_filter.o track.o util.o fasthash.o convert.o sdr_ifile.o sdr_beast.o sdr.o ais_charset.o globe_index.o geomag.o receiver.o aircraft.o api.o minilzo.o threadpool.o -pthread -lpthread -lm -lrt -lzstd -lz -lncurses -ltinfo
jlpoole@ryzdesk /usr/local/src/readsb $ make
rm -f viewadsb
cp readsb viewadsb
jlpoole@ryzdesk /usr/local/src/readsb $So, if people run into a problem with unsupported packages not compiling because of error messages above, then if there is a hint the problem is related to ncurses, the above may prove helpful in overcoming the problem.
