Find the answer to your Linux question:
Results 1 to 3 of 3
hi guys i am new to linux forums !!! i was trying to compile a small c program which uses the readline library in mandriva but its giving me all ...
  1. #1
    Just Joined!
    Join Date
    May 2008
    Posts
    1

    Smile hi guys...programming problem

    hi guys
    i am new to linux forums !!!
    i was trying to compile a small c program which uses the readline library in mandriva but its giving me all sorts of errors
    gcc filename
    or gcc filename -lreadline
    errors :-
    usr/local/lib/libreadline.so: undefined reference to `PC'
    /usr/local/lib/libreadline.so: undefined reference to `tgetflag'
    /usr/local/lib/libreadline.so: undefined reference to `tgetent'
    /usr/local/lib/libreadline.so: undefined reference to `UP'
    /usr/local/lib/libreadline.so: undefined reference to `tputs'
    /usr/local/lib/libreadline.so: undefined reference to `tgoto'
    /usr/local/lib/libreadline.so: undefined reference to `tgetnum'
    /usr/local/lib/libreadline.so: undefined reference to `BC'
    /usr/local/lib/libreadline.so: undefined reference to `tgetstr'
    collect2: ld returned 1 exit status
    any help ?

  2. #2
    Just Joined!
    Join Date
    Mar 2008
    Posts
    23
    hi

    1.can u post ur small c program as well? they might be some error inside.and can give us some clue of what s wrong
    2. Can u check if g++ is installed? use this command "g++ -v "
    to find it out. gcc may fail link to most of c libraries if g++ is not there.

    Good luck

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    So the issue here seems to be that you're not linking in the correct library. Interestingly, the link errors are coming from libreadline.so, so it appears that you need to link a second library as well (one on which libreadline depends). I don't know what this library might be, but if you can find some tutorial on using readline, it may have an example.
    DISTRO=Arch
    Registered Linux User #388732

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...