I’m trying to compile some code on my RaspberryPi 2 system, which is freshly installed with OSMC (OSMC_TGT_rbp2_20181101.img).
I’ve installed build-essential (apt-get install build-essential), which is all that is usually required on a debian system to get a working compiler.
The error that I’m getting is:
/usr/lib/gcc/arm-linux-gnueabihf/6/cc1: error while loading shared libraries: libmpc.so.3: cannot open shared object file: No such file or directory
Aptitude shows that libmpc3 is installed:
# aptitude search libmpc
i libmpc-dev - multiple precision complex floating-point library development package
i A libmpc3 - multiple precision complex floating-point library
I can also find the libmp3.so.3 file, which looks to be the correct location:
find /usr/lib -iname libmpc.so.3
/usr/lib/arm-linux-gnueabihf/libmpc.so.3
Just executing cc1 without any arguments results in the same error:
# /usr/lib/gcc/arm-linux-gnueabihf/6/cc1
/usr/lib/gcc/arm-linux-gnueabihf/6/cc1: error while loading shared libraries: libmpc.so.3: cannot open shared object file: No such file or directory
uname output:
# uname -a
Linux lounge 4.14.78-2-osmc #1 SMP PREEMPT Sun Oct 28 14:59:13 UTC 2018 armv7l GNU/Linux
I’ve googled for hours and tried various symlinks and ldconfig commands. I’ve updated apt cache and upgraded all packages. I’ve removed and reinstalled a lot of the gcc-related packages and nothing seems to make a difference.
I’m at the point now that I’m going to have to manually try compiling the affected packages, but would really like to avoid doing so. Any advice would be appreciated.
It looks like you’ve installed a bit more than just build-essential since neither aptitude nor libmpc-dev are part of the base OSMC build. It might simply be a bad flash to the SD card that’s causing this issue.
The cause of the problem isn’t clear. Unfortunately, you’ve not supplied any logs and we don’t know what you want to compile, so can’t even try to reproduce it. I see that you’re running as root, which is generally not necessary. Are you, for example, running it in a chroot jail?
Anyway, as a basic test, are you able to compile and run a simple Hello World program?
Installed both of those while trying to solve this issue.
I’m trying to install SickChill into a python virtualenv. Getting the error while trying build cffi python package. I’ve posted the exact error that I get when it is building.
I’m willing to provide any logs you can think of.
I’ve also tried using the binary python-cffi, which installs, but pip insists on installing a custom one.
Might be SD card. It got corrupt with previous (3 year old) installation of raspbian. I formatted and installed osmc. Very impressed with how easy everything has been up until now.
Was planning on getting a new SD card anyway, might as well do it now before too much customisation.
Thanks for the responses so far.
Could you perhaps give me md5 of your cc1 and libmpc.so.3?
Strange thing is that I did reinstall it, which should have replaced it with the version from the deb package.
Hello World:
osmc@lounge:/tmp$ gcc hello.c
/usr/lib/gcc/arm-linux-gnueabihf/6/cc1: error while loading shared libraries: libmpc.so.3: cannot open shared object file: No such file or directory