Cc1: error loading shared libraries: libmpc.so.2: cannot open shared object file: no such file or directory

I have a cross compiler in my home folder on Ubuntu 13.10 (64-bit). I downloaded it here at the bottom of the page that says "Prebuilt Toolchains". When I try to compile something, it gives me the following:

cc1: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory 

After a short review, I found this one . I tried the commands that the author wrote for input; but they will not help me, since I have this problem with a cross-compiler from the home dictionary, and not with the system compiler. Can anyone help?

EDIT: Here is the file I am trying to cross-compile:

 void print(char *message, int line,int ch){ char *vm=(char *)0xb8000; int i=(line*80*2); i=i+(ch*2); while(*message!=0){ if (*message=='\n'){line++; i=(line*80*2);} else {vm[i]=*message; i++; vm[i]=0x07; i++;} *message++;}} void kernel_main(){ print("Hello!\nHow do you like my kernel?",0,0);} 

I also have an assembly file written in AT & T syntax that calls kernel_main ().

+7
cross-compiling
source share
4 answers

My error disappeared after I issued the following commands:

 export LD_LIBRARY_PATH="/usr/local/lib" sudo ldconfig 

ldconfig is magic.

+8
source share

Could you find libmpc.so.3 in / usr / lib or / usr / lib64? If you find this or the same thing, you need to replace it with the libmpc.so.2 file. This file can be found in another version of Linux below.

+1
source share

version 2 libmpc (i.e. libmpc.2.dynlib) is created from versions 0.7 - 0.9 of the source code (find the download archives at www.multiprecision.org ). Versions earlier than 0.9 seem to be incompatible with newer versions of GMP , so I would try to create this first. I was able to build and use 0.9 on my OsX El Capitan system after installing gcc 4.8, gmp and mpfr:

 brew tap homebrew/versions brew install gcc48 brew install gmp brew install mpfr 

Then in mpc-0.9 dirctory:

 ./configure --with-gmp=/usr/local/Cellar/gmp/6.1.0 --with-mpfr=/usr/local/Cellar/mpfr/3.1.3 make sudo make install 
0
source share

I solved cc1: error while loading shared libraries: libmpc.so.2 as follows:

Install libmpc3 via repo and create a symlink (dirty method, but worked):

 sudo apt-get install libmpc* 

or (if toolchain for i386):

 sudo apt-get install libmpc*:i386 

in /usr/lib/i386-linux-gnu for i386 or in /usr/lib/x86_64-linux-gnu for amd64:

 sudo ln -s libmpc.so.3.0.0 libmpc.so.2 
0
source share

All Articles