5

While running doxygen I get the following error:

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

I have installed doxygen using sudo apt install doxygen on Ubuntu 17. In /usr/lib/x86_64-linux-gnu I have libclang-4.0.so.1 and libclang-5.0.so.1 but not libclang.so.6.

I have tried reinstalling doxygen and clang it doesn't help.

I also tried making a symbolic link called libclang.so.6 to the existing file libclang-5.0.so.1 as done here but it leads to this error:

doxygen: /usr/lib/x86_64-linux-gnu/libclang.so.6: version `LLVM_6.0' not found (required by doxygen)

How to resolve this error and get doxygen working?

4 Answers 4

5

The problem is solved by using this alternative method of installation. Follow these steps:

  1. Get copy of the repository

    git clone https://github.com/doxygen/doxygen.git
    cd doxygen
    
  2. Build

    mkdir build
    cd build
    cmake -G "Unix Makefiles" ..
    make
    
  3. Install

    sudo make install
    
3
  • 1
    Additionally I needed to set a symbolic link. The complete installation would be: apt-get install -y flex bison && cd /tmp && git clone https://github.com/doxygen/doxygen.git && cd doxygen && mkdir build && cd build && cmake -G "Unix Makefiles" .. && make && make install && ln -s /usr/local/bin/doxygen /usr/bin/doxygen
    – Murphy85
    Commented Jun 28, 2018 at 19:44
  • there should still be some way to install the binary distribution and link to libclang, instead of having to rebuild from source right? Commented Jul 19, 2021 at 18:47
  • to follow-up on my question, I figured it out and posted the answer here: stackoverflow.com/a/68446229/1898523 Commented Jul 19, 2021 at 19:50
4

On Ubuntu 20.04, I successfully installed the binary distribution from https://www.doxygen.nl/download.html#srcbin (doxygen-1.9.1.linux.bin.tar.gz which is "compiled using Ubuntu 20.04 and dynamically linked against libclang version 9"). Then by using apt-file program, I was able to find and install each missing library as follows:

$ doxygen --version
doxygen: error while loading shared libraries: libclang-9.so.1: cannot open shared object file: No such file or directory

$ apt-file search libclang-9.so.1
libclang1-9: /usr/lib/llvm-9/lib/libclang-9.so.1
libclang1-9: /usr/lib/x86_64-linux-gnu/libclang-9.so.1

$ sudo apt install libclang1-9
(...)

$ doxygen --version
doxygen: error while loading shared libraries: libclang-cpp.so.9: cannot open shared object file: No such file or directory

$ apt-file search libclang-cpp.so.9
libclang-cpp9: /usr/lib/llvm-9/lib/libclang-cpp.so.9
libclang-cpp9: /usr/lib/x86_64-linux-gnu/libclang-cpp.so.9

$ sudo apt install libclang-cpp9
(...)

$ doxygen --version
1.9.1 (ef9b20ac7f8a8621fcfc299f8bd0b80422390f4b)
0

firstly add this to your repo

deb http://apt.llvm.org/artful/ llvm-toolchain-artful-6.0 main
deb-src http://apt.llvm.org/artful/ llvm-toolchain-artful-6.0 main

now run the following

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
apt-get install clang-6.0 lldb-6.0 lld-6.0

--source http://apt.llvm.org/

0

You can also install doxygen using:

sudo apt install doxygen

It will install all dependencies by itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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