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
LDD(1)                                                       Linux Programmer's Manual                                                      LDD(1)

NAME
ldd - print shared object dependencies SYNOPSIS
ldd [option]... file... DESCRIPTION
ldd prints the shared objects (shared libraries) required by each program or shared object specified on the command line. An example of its use and output is the following: $ ldd /bin/ls linux-vdso.so.1 (0x00007ffcc3563000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f87e5459000) libcap.so.2 => /lib64/libcap.so.2 (0x00007f87e5254000) libc.so.6 => /lib64/libc.so.6 (0x00007f87e4e92000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f87e4c22000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f87e4a1e000) /lib64/ld-linux-x86-64.so.2 (0x00005574bf12e000) libattr.so.1 => /lib64/libattr.so.1 (0x00007f87e4817000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f87e45fa000) In the usual case, ldd invokes the standard dynamic linker (see ld.so(8)) with the LD_TRACE_LOADED_OBJECTS environment variable set to 1. This causes the dynamic linker to inspect the program's dynamic dependencies, and find (according to the rules described in ld.so(8)) and load the objects that satisfy those dependencies. For each dependency, ldd displays the location of the matching object and the (hexadeci- mal) address at which it is loaded. (The linux-vdso and ld-linux shared dependencies are special; see vdso(7) and ld.so(8).) Security Be aware that in some circumstances (e.g., where the program specifies an ELF interpreter other than ld-linux.so), some versions of ldd may attempt to obtain the dependency information by attempting to directly execute the program, which may lead to the execution of whatever code is defined in the program's ELF interpreter, and perhaps to execution of the program itself. (In glibc versions before 2.27, the upstream ldd implementation did this for example, although most distributions provided a modified version that did not.) Thus, you should never employ ldd on an untrusted executable, since this may result in the execution of arbitrary code. A safer alterna- tive when dealing with untrusted executables is: $ objdump -p /path/to/program | grep NEEDED Note, however, that this alternative shows only the direct dependencies of the executable, while ldd shows the entire dependency tree of the executable. OPTIONS
--version Print the version number of ldd. -v, --verbose Print all information, including, for example, symbol versioning information. -u, --unused Print unused direct dependencies. (Since glibc 2.3.4.) -d, --data-relocs Perform relocations and report any missing objects (ELF only). -r, --function-relocs Perform relocations for both data objects and functions, and report any missing objects or functions (ELF only). --help Usage information. BUGS
ldd does not work on a.out shared libraries. ldd does not work with some extremely old a.out programs which were built before ldd support was added to the compiler releases. If you use ldd on one of these programs, the program will attempt to run with argc = 0 and the results will be unpredictable. SEE ALSO
pldd(1), sprof(1), ld.so(8), ldconfig(8) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. 2017-09-15 LDD(1)
All times are GMT -4. The time now is 11:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy