Bug 112687 - Can't compile a simple example using readline.
Can't compile a simple example using readline.
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: readline (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-12-28 01:01 EST by Need Real Name
Modified: 2007-04-18 13:00 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-12-29 14:36:19 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2003-12-28 01:01:23 EST
Description of problem:

Failure to compile everytime readline is required.


Version-Release number of selected component (if applicable):

readline-4.3-5


How reproducible:

Completely reproducible in my pretty-much updated system.
The RPMs corresponding to most of the files usually required for
development (including readline and readline-devel) are installed.


Steps to Reproduce:

1.
Create a file with the name and content indicated by the next
step/item (i.e. 2.)

2.
$ cat tst-readline.c

#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>
                                                                     
          
int main()
{
  char* prompt="PROMPT>";
                                                                     
          
  char*  linealeida;
                                                                     
          
  linealeida = readline(prompt);
                                                                     
          
  printf("\n%s\n", linealeida);
}
                                                                     
          
3.
$ gcc -lreadline tst-readline.c -o tst-readline

Actual results:

/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libreadline.so:    
  undefined reference to `tgetnum'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libreadline.so:
undefined reference to `tgoto'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libreadline.so:
undefined reference to `tgetflag'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libreadline.so:
undefined reference to `BC'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libreadline.so:
undefined reference to `tputs'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libreadline.so:
undefined reference to `PC'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libreadline.so:
undefined reference to `tgetent'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libreadline.so:
undefined reference to `UP'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libreadline.so:
undefined reference to `tgetstr'
collect2: ld returned 1 exit status


Expected results:

(a succesfull compilation and the file tst-readline created)

Additional info:

I'm a readline newbie, and therefore I might be missing something. If
so, please say how a simple readline example should be compiled. BTW,
I guess the problem might be asociated to readline not being correctly
linked againste either curses(terminfo) or termcap.
Thanks.
Comment 1 Need Real Name 2003-12-29 14:36:19 EST
Add "-ltermcap" to gcc's command line.

Note You need to log in before you can comment on or make changes to this bug.