Score:0

shared library dependencies wrong path

in flag

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?

N0rbert avatar
zw flag
What was wrong with https://packages.ubuntu.com/focal/clazy ? Why do you blame OS while you have played with `/usr/local` ?
hr flag
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`)?
FROST SKIPPER avatar
in flag
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 avatar
in flag
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 avatar
in flag
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 avatar
in flag
/usr/local/clang-12/lib/libclang-cpp.so.12 --version --> bash: /usr/local/clang-12/lib/libclang-cpp.so.12: Permission denied
Score:0
in flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.