clang: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
Asked Answered
S

4

62

I'm building a substratum theme from https://github.com/substratum/template

I'm getting the following errors on run:

Build command failed.
Error while executing process /home/anubhav/Android/Sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/anubhav/AndroidStudioProjects/template/app/src/main/jni/Android.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-24 NDK_OUT=/home/anubhav/AndroidStudioProjects/template/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/home/anubhav/AndroidStudioProjects/template/app/build/intermediates/ndkBuild/debug/lib /home/anubhav/AndroidStudioProjects/template/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/libLoadingProcess.so}
[armeabi-v7a] Compile thumb  : LoadingProcess <= LoadingProcess.c
/home/anubhav/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang: error while loading shared libraries: libtinfo.so.5: cannot open       shared object file: No such file or directory
make: *** [/home/anubhav/AndroidStudioProjects/template/app/build/intermediates/ndkBuild/debug/obj/local/armeabi-v7a/objs-debug/LoadingProcess/LoadingProcess.o] Error 127 

I'm running Android Studio 3.0.1 on Manjaro. I really don’t know what else info to provide, so please mention if anything is required.

Selfinterest answered 7/2, 2018 at 22:9 Comment(0)
C
130

I had the same problem on Debian Buster. Installing the Debian package libncurses5 solved it for me:

$ sudo apt install libncurses5
Cluny answered 13/7, 2018 at 23:3 Comment(10)
I got a similar problem for my Debian buster docker image. I solved it by installing libncurses5-dev and libncursesw5-devHawkins
non -dev for me, The following NEW packages will be installed: libncurses5 libtinfo5{a} -4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/LinuxSwede
Same problem on Ubuntu 19.10, solved by installing libncurses5Orvah
For Fedora you need to install ncurses-compat-libs see github.com/spacchetti/spago/issues/104#issuecomment-563100691Hawkins
I got similar problem when using kotlinc-native. Installing libncurses5 fixed it! Thanks!Snuff
Works for me on Ubuntu Linux. Had the same error when tried to run Tensilica C compiler xt-clang.Broadminded
in debian bullseye the same error may appear because libffi6 is not in the distribution (but libffi7 is) and thus the installation of the additioanl packages fails.Jonijonie
This fixed the error, while making a WebGL project on Ubuntu 21.04. installing ncurses5 installed libtinfo5, which Unity 2020.3.7f1 (lts) needed to compile and build.Susie
worked on ubuntu 20-04. Setting a 'so.5' symbolic link to the existing libcurses did not work e.g sudo ln -s /usr/lib/x86_64-linux-gnu/libncurses.so /usr/lib/libncurses.so.5. That library is not compatible with ndk r16b. Had to install the version-5 as per this answer.Wilt
The correct address to download the library libncurses5 is https://packages.debian.org/libncurses5Haematogenesis
B
11

ln -s /usr/lib/libncursesw.so.6 /usr/lib/libtinfo.so.5

Ballinger answered 22/2, 2020 at 23:11 Comment(4)
Can you explain that a bit? Are these two versions binary compatible? Do they even do the same thing? Why not rather install the required dependencies instead? See also How to Answer.Misconstrue
Honestly, laziness to search for the required library. Since both have the required internal procedures, it won't matter for the calling library.Ballinger
ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /usr/lib/libtinfo.so.5 in my case, but yeah this worked and fixed pytorch for me. Normally I don't like this type of answer, but what can I say.... have an upvote.Bharal
Brilliant idea, this worked for me on Fedora! In my case it was ln -s /usr/lib64/libtinfo.so.6 /usr/lib64/libtinfo.so.5 and it was for an old precompiled version of include-what-you-use.Sorrows
L
1

libtinfo is not an Android API. You need to build that library for Android and include it in your APK.

Latimer answered 14/5, 2018 at 21:9 Comment(0)
A
0

TLDR:

Edit /etc/apt/sources.list.d/ubuntu.sources

Add these lines to the bottom (Don't know if this is 100% correct)

Types: deb
URIs: HTTP://archive.ubuntu.com/ubuntu/
Suites: lunar
Components: universe

sudo apt update

sudo apt-get install libtinfo5

My process

I got this same issue when trying to run clang++ on a new install of ubuntu24.04

But this package would not install

sudo apt install libncurses5

And neither would linking work because a specific function within libtinfo.so.5

ln -s /usr/lib/libncursesw.so.6 /usr/lib/libtinfo.so.5

I found this article for a completely different problem https://askubuntu.com/questions/1491254/installing-cuda-on-ubuntu-23-10-libt5info-not-installable

Which suggested this process

Open a terminal window and run:

sudo nano /etc/apt/sources.list

Add this line (adds the Ubuntu 23.04 aka "Lunar Lobster" universe repository to apt):

deb http://archive.ubuntu.com/ubuntu/ lunar universe

Save and exit, then run:

sudo apt update

But, /etc/apt/sources.list is outdated

Go to /etc/apt/sources.list.d/ubuntu.sources instead

I then added this to the file

Types: deb
URIs: HTTP://archive.ubuntu.com/ubuntu/
Suites: lunar
Components: universe

Then I apt update try to install libtinfo5 directly and it worked

sudo apt-get install libtinfo5

Amador answered 15/5 at 18:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.