Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doxygen: cannot find the shared library(s) 'libclang.so.6'

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?

like image 488
arpanmangal Avatar asked Mar 11 '18 13:03

arpanmangal


2 Answers

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
    
like image 151
arpanmangal Avatar answered Oct 03 '22 04:10

arpanmangal


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)
like image 36
wrapperapps Avatar answered Oct 03 '22 05:10

wrapperapps