0

I built clazy with clang-12 but Qt creator gives an error:

The command "/usr/local/clazy/bin/clazy-standalone --version" terminated with exit code 127. /usr/local/clazy/bin/clazy-standalone: error while loading shared libraries: libclang-cpp.so.12: cannot open shared object file: No such file or directory

I have added the correct directories to .bashrc:

  • export PATH=/usr/local/clang-12/bin:$PATH
  • export LD_LIBRARY_PATH=/usr/local/clang-12/lib:$LD_LIBRARY_PATH

Here is a print of shared object dependencies for clazy-standalone:

    linux-vdso.so.1 (0x00007ffd9ebe0000)
    ClazyPlugin.so => /usr/local/clazy/lib/ClazyPlugin.so (0x00007f06c929d000)
    libclang-cpp.so.12 => /usr/local/clang-12/lib/libclang-cpp.so.12 (0x00007f06c4b2b000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f06c4b08000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f06c4b02000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f06c4adf000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f06c4990000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f06c4972000)
    libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f06c4942000)
    libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f06c4761000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f06c4746000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f06c4554000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f06c9437000)

Here is a print of shared object dependencies for libclang-cpp.so.12:

    linux-vdso.so.1 (0x00007ffee8df9000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fbe393b1000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fbe393a6000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fbe393a0000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fbe39251000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fbe39235000)
    libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fbe39205000)
    libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fbe39022000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fbe39007000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbe38e15000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fbe3db60000)

libcland-cpp.so.12 is not a symlink.

Again the comment by @N0rbert provides no value. I have other similar problems which I suspect stem from this type of issue. Linux can't for some reason find or use the files given.

I found posts of issues with shared libraries from 2005, so obviously I am not the only one.

Can someone finally give a proper answer on how to deal with this type of problem? That way people like me don't have to spend hours reading posts with no answers. Or is this a "feature" of Linux?

6
  • 2
    What was wrong with packages.ubuntu.com/focal/clazy ? Why do you blame OS while you have played with /usr/local ? – N0rbert Jun 11 at 16:44
  • Is /usr/local/gcc-11.1.0/lib64/libstdc++.so.6 an actual file, or a symbolic link? if the latter, where does it resolve to (ex. realpath /usr/local/gcc-11.1.0/lib64/libstdc++.so.6)? – steeldriver Jun 11 at 20:01
  • The first question is a loaded question which will only lead to arguments. So, no comment. I read that </usr/local/> is the recommended path to install additional apps. If that's wrong, hey great. What you could've done N0rbert, is given the correct path rather than just troll. In case you couldn't read between the lines, I have done this on Windows and had zero issues. On Ubuntu all I get is a headache. – FROST SKIPPER Jun 12 at 11:16
  • Apparently it's a symlink and realpath gives: </usr/local/gcc-11.1.0/lib64/libstdc++.so.6.0.29>. That file exists. Doing --version on it, gives "Segmentation fault (core dumped)". I guess that means I have a problem with the gcc-11 installation. Don't know how to go about figuring what's wrong with that. I don't get why the gcc-11 compilation is successful when the end product doesn't work. – FROST SKIPPER Jun 12 at 11:25
  • I compiled clazy on clang-12 and get a similar problem. The command "/usr/local/clazy/bin/clazy-standalone --version" terminated with exit code 127. /usr/local/clazy/bin/clazy-standalone: error while loading shared libraries: libclang-cpp.so.12: cannot open shared object file: No such file or directory. – FROST SKIPPER Jun 12 at 11:32
0

Yeah, okay. So I gave Linux a chance and this is a fundamental problem among many others that the community hasn't fixed.

If you build programs, don't get errors but still shared libraries are not working, and you have all the required packages installed. There is a solution. Install Windows, it actually works and you don't have to waste time on this sad excuse of an operating system.

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.