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: Thomas Dickey
Subject: Re: undefined reference to `exit_curses'
Date: Sat, 20 Jun 2020 19:18:10 -0400 (EDT)

----- Original Message -----
| From: "noloader" <noloader@gmail.com>
| To: "Thomas Dickey" <dickey@his.com>
| Cc: "Ncurses Mailing List" <bug-ncurses@gnu.org>
| Sent: Saturday, June 20, 2020 6:46:28 PM
| Subject: Re: undefined reference to `exit_curses'

| 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.

I suppose it's picking up the older headers, but to see that someone will
have to debug it (at the moment I'm busy - perhaps tomorrow).

-- 
Thomas E. Dickey <dickey@invisible-island.net>
http://invisible-island.net
ftp://ftp.invisible-island.net



reply via email to

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