I am trying to build GDB from source, and am encountering a strange problem. I'm not sure what information is relevant, so please let me know if I have not provided enough.

I am working on Linux Mint. I have a tarball of the various gdb source files and build scripts, which was provided in a class.

When executing one of the build scripts (linux-targ), which I can post if it's valuable, I encounter the following error.

.../gdb/install.sh -c -m 644 libreadline.a /usr/local/lib/libreadline.a  
install:  libreadline.a does not exist  
make[1]:  [install] Error 1  

This is the line in the install.sh script that is failing.

    if [ -f $src -o -d $src ]  
            echo "install:  $src does not exist"  
            exit 1  

I've tried copying a libreadline.a to the local directory, but that failed also.

However, /usr/local/lib/libreadline.a does exist. I have even removed it and reinstalled. It also doesn't seem to matter if I run this as root.

Why is the install script reporting that libreadlines.a does not exist?

If this is the wrong SE, please suggest an alternative.

  • Thanks for editing code. Is there a help guide for formatting questions? I've never been able to figure it out. – Michael Aug 2 '13 at 4:58
  • There's a help button in the editor (top-right). Also the build script is reporting it can't find libreadline in its current directory. It's trying to install it to /usr/local/lib. Since you're using custom scripts I don't think we can really help you here. Make sure you've run all the scripts in the documented order, and ask your teacher if you can't figure it out. – Mat Aug 2 '13 at 5:00

It seems that you don't have installed the libreadline libraries.I don't know on which linux dist you are using. For ubuntu install the library with:

sudo apt-get install libreadline7

otherwise the path to your library is not correctly set.


If the linker is complaining about not finding a ".a" file, then it means it's linking to the library statically. Installing the "readline-devel" package is not enough. You will also need to install the "readline-static" package as well.

Using Centos 7, those are the package names I needed to install to build something that linked to readline statically. Other distributions may differ.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.