Sponsored Content
Top Forums Programming Trouble compiling program using the readline library. Post 302876461 by stf92 on Sunday 24th of November 2013 07:44:34 PM
Old 11-24-2013
Trouble compiling program using the readline library.

Hi: in the info page for readline library I read
Code:
 -- 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
     re-read.

And wrote a little C program:
Code:
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);

main(){
    rl_variable_dumper(0);
}
       
semoi@server:~/work$

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

you see what I get. What am I doing wrong?
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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

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

7. 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

8. 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

9. 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
PLDD(1) 							 Linux User Manual							   PLDD(1)

NAME
pldd - display dynamic shared objects linked into a process SYNOPSIS
pldd PID pldd OPTION DESCRIPTION
The pldd command displays a list of the dynamic shared objects that are linked into the process with the specified process ID. The list includes the libraries that have been dynamically loaded using dlopen(3). OPTIONS
-?, --help Display program help message. --usage Display a short usage message. -V, --version Display the program version. VERSIONS
pldd is available since glibc 2.15. CONFORMING TO
The pldd command is not specified by POSIX.1. Some other systems have a similar command. EXIT STATUS
On success, pldd exits with the status 0. If the specified process does not exist, the user does not have permission to access its dynamic shared object list, or no command-line arguments are supplied, pldd exists with a status of 1. If given an invalid option, it exits with the status 64. EXAMPLE
$ echo $$ # Display PID of shell 1143 $ pldd $$ # Display DSOs linked into the shell 1143: /usr/bin/bash linux-vdso.so.1 /lib64/libtinfo.so.5 /lib64/libdl.so.2 /lib64/libc.so.6 /lib64/ld-linux-x86-64.so.2 /lib64/libnss_files.so.2 NOTES
The command lsof -p PID also shows output that includes the dynamic shared objects that are linked into a process. SEE ALSO
ldd(1), lsof(1), dlopen(3), ld.so(8) GNU
2014-09-27 PLDD(1)
All times are GMT -4. The time now is 02:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy