Ask a Question related to UNIX Programming, Design and Development.
-
Jason #1
readline problem [libreadline.so: undefined reference to...]
I'm running RedHat 7.1 and I can't get the readline author's example program
to compile (nor any other readline-using program). Any suggestions? Here
are the error messages:
[root@db:/home/jake/weber/unix/readline-example]$ gcc -lreadline rl.c
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
reference to `tgetnum'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
reference to `tgoto'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
reference to `tgetflag'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
reference to `BC'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
reference to `tputs'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
reference to `PC'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
reference to `tgetent'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
reference to `UP'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
reference to `tgetstr'
collect2: ld returned 1 exit status
Jason Guest
-
undefined reference to 'boot_DynaLoader'
Hi, I tried embedding perl into C, and inserted these coz i had an error prior to this one... -
undefined reference to errno
I've upgraded to Slackware 9.1, which includes gcc-3.2.3, and I'm having problems linking (in this case) Art Kagel's utils2_ak programs with... -
#25538 [Csd->Bgs]: undefined reference
ID: 25538 Updated by: sniper@php.net Reported By: carlo dot beccaria at sys-net dot it -Status: Closed... -
#25538 [NEW]: undefined reference
From: carlo dot beccaria at sys-net dot it Operating system: linux PHP version: 5CVS-2003-09-15 (dev) PHP Bug Type: *Compile... -
libreadline problem on installation
Hi I am trying to install samba 2.2.4-2 under RedHat Linux 7.2 (I need compatibliity with other installations). It compliains that there is no... -
Maurizio Loreti #2
Re: readline problem [libreadline.so: undefined reference to...]
"Jason" <jake1138@NO.SPAM.yahoo.com> writes:
RTFM. gcc -lreadline -termcap rl.c> I'm running RedHat 7.1 and I can't get the readline author's example program
> to compile (nor any other readline-using program). Any suggestions? Here
> are the error messages:
>
> [root@db:/home/jake/weber/unix/readline-example]$ gcc -lreadline rl.c
> /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
> reference to `tgetnum'
> /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
> reference to `tgoto'
> /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
> reference to `tgetflag'
> /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
> reference to `BC'
> /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
> reference to `tputs'
> /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
> reference to `PC'
> /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
> reference to `tgetent'
> /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
> reference to `UP'
> /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so: undefined
> reference to `tgetstr'
> collect2: ld returned 1 exit status
--
Maurizio Loreti [url]http://www.pd.infn.it/~loreti/mlo.html[/url]
Dept. of Physics, Univ. of Padova, Italy ROT13: [email]ybergv@cq.vasa.vg[/email]
Maurizio Loreti Guest
-
Paul Pluzhnikov #3
Re: readline problem [libreadline.so: undefined reference to...]
Maurizio Loreti <mlo@foobar.it> wrote in message news:<rmy8z1u0pe.fsf@mlinux.pd.infn.it>...
Better make that "gcc rl.c -lreadline -ltermcap".> gcc -lreadline -termcap rl.c
The order of sources and libraries matters, and so does spelling.
Cheers,
Paul Pluzhnikov Guest
-
Jason #4
Re: readline problem [libreadline.so: undefined reference to...]
"Maurizio Loreti" <mlo@foobar.it> wrote in message
news:rmy8z1u0pe.fsf@mlinux.pd.infn.it...program> "Jason" <jake1138@NO.SPAM.yahoo.com> writes:
>> > I'm running RedHat 7.1 and I can't get the readline author's exampleHere> > to compile (nor any other readline-using program). Any suggestions?undefined> > are the error messages:
> >
> > [root@db:/home/jake/weber/unix/readline-example]$ gcc -lreadline rl.c
> > /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so:undefined> > reference to `tgetnum'
> > /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so:undefined> > reference to `tgoto'
> > /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so:undefined> > reference to `tgetflag'
> > /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so:undefined> > reference to `BC'
> > /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so:undefined> > reference to `tputs'
> > /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so:undefined> > reference to `PC'
> > /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so:undefined> > reference to `tgetent'
> > /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so:undefined> > reference to `UP'
> > /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libreadline.so:[url]http://www.pd.infn.it/~loreti/mlo.html[/url]>> > reference to `tgetstr'
> > collect2: ld returned 1 exit status
> RTFM. gcc -lreadline -termcap rl.c
>
> --
> Maurizio Loreti[email]ybergv@cq.vasa.vg[/email]> Dept. of Physics, Univ. of Padova, Italy ROT13:
And what FM would that be?
I can compile this just fine on a Debian system with just -lreadline, but
not on either of the RedHat systems that I've tried. I can add -ltermcap
or -lncurses and either one will allow it to compile though. Anyone care to
shed some light on why? What does readline have to do with termcap or
ncurses? By the way, thanks for your responses.
--
Jason
[ jake1138 AT yahoo DOT com ]
Jason Guest
-
Paul Pluzhnikov #5
Re: readline problem [libreadline.so: undefined reference to...]
"Jason" <jake1138@NO.SPAM.yahoo.com> wrote in message news:<bf0316$sk7$1@terabinaries.xmission.com>...
This doesn't appear to be documented in the info pages ;-(> And what FM would that be?
You could have figured it out, though:
$ nm -AD /usr/lib/lib*.so 2>/dev/null | grep ' tgetnum'
/usr/lib/libcurses.so:00029140 T tgetnum
/usr/lib/libncurses.so:00029140 T tgetnum
/usr/lib/libreadline.so: U tgetnum
/usr/lib/libtermcap.so:00001e60 T tgetnum
Probably because libreadline.so on Debian has a dynamic dependency on> I can compile this just fine on a Debian system with just -lreadline, but
> not on either of the RedHat systems that I've tried. I can add -ltermcap
> or -lncurses and either one will allow it to compile though. Anyone care to
> shed some light on why?
libtermcap.so or libncurses.so, while on RedHat it doesn't.
Run "ldd your_exe" to find which libreadline.so it uses, then
"ldd /path/to/libreadline.so" on both systems, and compare the results.
It needs to redraw your screen (well, just the line on which you are typing),> What does readline have to do with termcap or ncurses?
and position your cursor. That's precisely what lib{curses,termcap} do.
Typing "info termcap" will tell you more.
Cheers,
Paul Pluzhnikov Guest



Reply With Quote

