Trouble compiling program using the readline library.

Thread Tools Search this Thread
Top Forums Programming Trouble compiling program using the readline library.
# 1  
Old 11-24-2013
Trouble compiling program using the readline library.

Hi: in the info page for readline library I read
 -- Function: void rl_variable_dumper (int readable)
     Print the readline variable names and their current values to
     `rl_outstream'.  If READABLE is non-zero, the list is formatted in
     such a way that it can be made part of an `inputrc' file and

And wrote a little C program:
semoi@server:~/work$ cat dumpall.c                      
# Compile with 'gcc -Wall -lreadline -o dumpall dumpall.c'

#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>

extern void rl_variable_dumper(int john);


semoi@server:~/work$ gcc -o dumpall dumpall.c -lreadline
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../lib64/ undefined reference to `tputs'
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../lib64/ undefined reference to `tgoto'
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../lib64/ undefined reference to `tgetflag'
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../lib64/ undefined reference to `UP'
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../lib64/ undefined reference to `tgetent'
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../lib64/ undefined reference to `tgetnum'
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../lib64/ undefined reference to `PC'
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../lib64/ undefined reference to `tgetstr'
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../lib64/ undefined reference to `BC'
collect2: error: ld returned 1 exit status

you see what I get. What am I doing wrong?
# 2  
Old 11-25-2013
Add -lncurses
This User Gave Thanks to cjcox For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Compiling GCC 6.3.0 - Error with Library

First of all -- thanks for being patient with me. I hope I'm submitting this correctly. Also I haven't done UNIX Admin since the early 1990's. I'm actually a DBA. But, since I'm the one in the office with the UNIX experience, I'm the SA. I haven't been able to compile GCC 6.3.0 which I need... (9 Replies)
Discussion started by: PJ_Namias
9 Replies

2. Programming

Symbols not found for architecture: trouble compiling with C++

Hello, I am writing a program which relies on some heavy astronomy calculations, so I am using libnova c++ astronomy libraries => libnova: libnova. I started off with a simple program to make sure everything compiled ok (below) //Simple example program to test Libnova C++ class libraries ... (2 Replies)
Discussion started by: Tyler_92
2 Replies

3. Programming

MinGW - Trouble Compiling Guile

This question is not about programming but compiling with GNU GCC/Make. I am not on a UNIX machine but am using the UNIX-like environment MSYS with MinGW for compiling. The problem that I am having is that I cannot get guile to compile. For some reason it cannot find libltdl which is part of... (3 Replies)
Discussion started by: Deluge
3 Replies

4. Programming

Library problem - not compiling in c

Ok I was trying to test if I installed correctly gsl, I followed the INSTALL file and still I don't know what is wrong. Here is a sample code to test gel,I got it from Random Number Generator Examples - GNU Scientific Library -- Reference Manual (note: made a few changes in the code) #include... (2 Replies)
Discussion started by: joseamck
2 Replies

5. Linux

Compiling with multiple versions of a library

Hello! I have a set of headers and libraries I want to use but they are mixed with ones I do not want to use. They are part of some official stuff, so I cannot modify them while begging and pleading for weeks. These headers and libraries are located here /long/official/path/to/include... (0 Replies)
Discussion started by: gobi
0 Replies

6. Programming

help on compiling a C program on Tiger

here is the very simple bob.c: main() { printf("hello"); } i use tiger and i use the command: gcc bob.c and the end result: bob.c: In function ‘main': bob.c:3: warning: incompatible implicit declaration of built-in function /‘printf' any help appreciated, i'm just starting... (4 Replies)
Discussion started by: cleansing_flame
4 Replies

7. Programming

Compiling a C program

Help I know nothing about c programming. :confused: I want to compile the below c program. It extracts data from an oracle database into csv files. I have oracle 9206 installed with ProC. I dont have gcc My question is. How the hell do I make this into an file I can run? I am pulling... (3 Replies)
Discussion started by: ooploo
3 Replies

8. Programming

Problem compiling program

hi i am having a problem that when ever i use cc program_name.c to compile a program. an error occurs, showing cc not found. please help. (28 Replies)
Discussion started by: rochitsharma
28 Replies

9. Programming

Compiling a program

Hello. I am trying to run a c program on a unix shell (ssh). I have searched this forum but have not come accross the soultion to my problem, so I am posting my question here :cool: I wrote the following simple code: #include <iostream.h> using namespace std; int main() { ... (7 Replies)
Discussion started by: Minnesota Red
7 Replies
Login or Register to Ask a Question