LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-02-2007, 03:51 AM   #1
Jacko123
LQ Newbie
 
Registered: Mar 2007
Posts: 13

Rep: Reputation: 0
Readline command error


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.
 
Old 03-02-2007, 07:51 AM   #2
Jacko123
LQ Newbie
 
Registered: Mar 2007
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks guys I got it...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
undefined reference to readline lilili Programming 6 10-22-2006 10:28 PM
apt + readline + postfix + etc... Sapient Linux - Software 2 01-04-2006 09:03 AM
Postgresql 7.4.2 with Readline on Debian 3.0 jockster666 Linux - Software 1 03-07-2005 04:17 PM
readline compile feetyouwell Programming 1 10-06-2004 06:01 PM
relocation error with postres & readline wdpp Linux - Software 5 04-08-2004 04:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration