vermarajeev
2nd March 2007, 10:35
Hi guys,
I wrote a code something like this
Code:
#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>
int main()
{
char* p = readline("Enter a password:");
printf("You entered:%s", p);
return 0;
}I save the file as-->
pass.c
I compile it as-->
cc pass.c -l readline
I get so many errors as shown
Code:
g++ -o testncursors main.o -L/usr/lib/qt-3.3/lib -L/usr/X11R6/lib
/usr/lib/libreadline.a -lqt-mt -lXext -lX11 -lm
/usr/lib/libreadline.a(display.o)(.text+0x1d7): In function `cr':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x243): In function `_rl_move_vert':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x290): In function `_rl_move_vert':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x30a): In function
`_rl_clear_to_eol':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x6e0): In function
`_rl_clear_screen':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0xbc9): more undefined
references to `tputs' follow
/usr/lib/libreadline.a(display.o)(.text+0x1a2d): In function `update_line':
: undefined reference to `tgoto'
/usr/lib/libreadline.a(display.o)(.text+0x1a45): In function `update_line':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x1c03): In function `update_line':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x1dbd): In function `update_line':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x1e04): In function `update_line':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x1e75): In function `update_line':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x1ef3): In function `update_line':
: undefined reference to `tgoto'
/usr/lib/libreadline.a(display.o)(.text+0x1f0a): In function `update_line':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x33d7): In function `rl_redisplay':
: undefined reference to `tputs'
/usr/lib/libreadline.a(terminal.o)(.text+0x1f6): In function
`_rl_backspace':
: undefined reference to `tputs'
/usr/lib/libreadline.a(terminal.o)(.text+0x2b9): In function `rl_ding':These errors are just a part. There are still many
The library is linked but I dont know what is the problem???? Please help... I'm eagerly waiting for a reply.
I wrote a code something like this
Code:
#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>
int main()
{
char* p = readline("Enter a password:");
printf("You entered:%s", p);
return 0;
}I save the file as-->
pass.c
I compile it as-->
cc pass.c -l readline
I get so many errors as shown
Code:
g++ -o testncursors main.o -L/usr/lib/qt-3.3/lib -L/usr/X11R6/lib
/usr/lib/libreadline.a -lqt-mt -lXext -lX11 -lm
/usr/lib/libreadline.a(display.o)(.text+0x1d7): In function `cr':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x243): In function `_rl_move_vert':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x290): In function `_rl_move_vert':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x30a): In function
`_rl_clear_to_eol':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x6e0): In function
`_rl_clear_screen':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0xbc9): more undefined
references to `tputs' follow
/usr/lib/libreadline.a(display.o)(.text+0x1a2d): In function `update_line':
: undefined reference to `tgoto'
/usr/lib/libreadline.a(display.o)(.text+0x1a45): In function `update_line':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x1c03): In function `update_line':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x1dbd): In function `update_line':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x1e04): In function `update_line':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x1e75): In function `update_line':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x1ef3): In function `update_line':
: undefined reference to `tgoto'
/usr/lib/libreadline.a(display.o)(.text+0x1f0a): In function `update_line':
: undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x33d7): In function `rl_redisplay':
: undefined reference to `tputs'
/usr/lib/libreadline.a(terminal.o)(.text+0x1f6): In function
`_rl_backspace':
: undefined reference to `tputs'
/usr/lib/libreadline.a(terminal.o)(.text+0x2b9): In function `rl_ding':These errors are just a part. There are still many
The library is linked but I dont know what is the problem???? Please help... I'm eagerly waiting for a reply.