bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undefined reference to `exit_curses'


From: Jeffrey Walton
Subject: Re: undefined reference to `exit_curses'
Date: Sat, 20 Jun 2020 18:46:28 -0400

On Sat, Jun 20, 2020 at 6:43 PM Thomas Dickey <dickey@his.com> wrote:
>
> On Sat, Jun 20, 2020 at 05:34:47PM -0400, Jeffrey Walton wrote:
> > On Sat, Jun 20, 2020 at 4:42 PM Jeffrey Walton <noloader@gmail.com> wrote:
> > >
> > > Hi Everyone/Thomas,
> > >
> > > I'm catching this error after upgrading to Ncurses 6.2:
> > >
> > > gcc -g2 -O2 -march=native -fPIC -pthread  -o background
> > > ../obj_s/background.o ../obj_s/dump_window.o
> > > -L/home/jwalton/tmp/ok2delete/lib -Wl,-R,'$ORIGIN/../lib'
> > > -Wl,-R,/home/jwalton/tmp/ok2delete/lib -Wl,--enable-new-dtags -I. -I.
> > > -I../test -DHAVE_CONFIG_H
> > > -DDATA_DIR=\"/home/jwalton/tmp/ok2delete/share\" -I. -I../include
> > > -I/home/jwalton/tmp/ok2delete/include -DNDEBUG -D_DEFAULT_SOURCE
> > > -D_XOPEN_SOURCE=600 -DNDEBUG -g2 -O2 -march=native -fPIC -pthread
> > > -fPIC  `echo "-L../lib -lform -lmenu -lpanel -lncurses -ltinfo  -ldl
> > > -lpthread" | sed -e 's/-lform.*-lpanel[^ ]*//'` -lutil  -lm
> > > ../obj_s/background.o: In function `usage':
> > > /home/jwalton/Build-Scripts/ncurses-6.2/test/../test/background.c:153:
> > > undefined reference to `exit_curses'
> > > ../obj_s/background.o: In function `main':
> > > /home/jwalton/Build-Scripts/ncurses-6.2/test/../test/background.c:198:
> > > undefined reference to `exit_curses'
> > > /home/jwalton/Build-Scripts/ncurses-6.2/test/../test/background.c:240:
> > > undefined reference to `exit_curses'
> > > collect2: error: ld returned 1 exit status
> >
> > The following patch does not help.
>
> exit_curses is declared in include/nc_alloc.h, and used in the ExitProgram
> macro which is defined in test/test.priv.h
>
> Lacking that would give a compiler warning (not an error).
>
> The linker error tells you that it's not finding exit_curses in
>
>         ../lib/libncurses.a
>         ../lib/libncurses.so, etc
>
> > --- test/background.c
> > +++ test/background.c
> > @@ -35,6 +35,10 @@
> >  #include <color_name.h>
> >  #include <dump_window.h>
> >
> > +#ifdef NO_LEAKS
> > +extern NCURSES_EXPORT(void) exit_curses (int) GCC_NORETURN;
> > +#endif
> > +
> >  static int default_bg = COLOR_BLACK;
> >  static int default_fg = COLOR_WHITE;

Thanks.

What is needed to fix the problem? Can you provide a prescriptive
recipe? I.e., detail each step you would like us to perform.

Jeff



reply via email to

[Prev in Thread] Current Thread [Next in Thread]