8

How can I install libdwarf.so on Ubuntu? I get this error while running an executable file.

error while loading shared libraries: libdwarf.so: cannot open shared object file: No such file or directory.

1

2 Answers 2

5

So after too many hours finally it's been solved. It goes like this:

  1. Download libdwarf-20130207.tar.gz
  2. Extract the archive and in a new terminal type:

    cd dwarf-2013-02-07/libdwarf
    ./configure --enable-shared
    make -j$(nproc)
    
  3. If you need a 32 bit library (as in my case), just open the MakeFile and add -m32 to CFLAGS

    CFLAGS = -m32 $(PREINCS) -g -O2 $(INCLUDES) $(dwfpic) $(POSTINCS)
    
  4. At the end, just copy the libdwarf.so into /usr/lib

1
  • Thanks Petter Bajo. You answer with compiling the source and copying the library worked. I wanted to up your answer but I did not have enough points to do so. BTW, I also needed to install libelf-dev required for the compilation of the code.
    – feradz
    Aug 6, 2014 at 14:28
2

I suspect this wasn't true when the question was asked, but in 2018:

sudo apt-get install libelf-dev libdwarf-dev

You might also be interested in https://github.com/aclements/libelfin.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .