Find the answer to your Linux question:
Results 1 to 8 of 8
i just Code: gcc -c hello hello.c get this message Code: error while loading share libraries "libmpc.so.2 not found" then i check out Code: ls -l /usr/lib/libmpc.so.2 and it is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2014
    Posts
    6

    error while loading share libraries "libmpc.so.2 not found"


    i just
    Code:
     gcc -c hello hello.c
    get this message
    Code:
    error while loading share libraries  "libmpc.so.2 not found"
    then i check out
    Code:
    ls -l /usr/lib/libmpc.so.2
    and it is a link
    Code:
    libmpc.so.2 --->libmpc.so.3
    but i cannot found libmpc.so.3

  2. #2
    Linux Newbie nihili's Avatar
    Join Date
    Dec 2013
    Posts
    171
    post the "hello.c" program here, please.

    if libmpc.so.2 is a link, it tells you where it links to; what you posted suggests libmpc.so.3 is in the same directory. if it isn't then the link is broken. it could mean you have to install the library that provides libmpc.so.3.

  3. #3
    Just Joined!
    Join Date
    Jun 2014
    Posts
    6
    Quote Originally Posted by nihili View Post
    post the "hello.c" program here, please.

    if libmpc.so.2 is a link, it tells you where it links to; what you posted suggests libmpc.so.3 is in the same directory. if it isn't then the link is broken. it could mean you have to install the library that provides libmpc.so.3.
    it links to libmpc.so.3 , they are all in the same directory
    but i am not sure where can i download libmpc.so.3 , i thi
    nk it is a share library for gcc compiler just in linux.

    Code:
    /* hello.c */
    int main(int argc, char **argv)
    {
        printf("welcome to wayQiu.com\n");
    }

  4. #4
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,293
    I think the issue is your command line - and nothing to do with libmpc. You're certainly not using it.

    Try:
    Code:
    gcc hello.c -o hello
    Then try:
    Code:
    gcc -Wall hello.c -o hello
    and read the warnings.

  5. #5
    Just Joined!
    Join Date
    Jun 2014
    Posts
    6
    Quote Originally Posted by gregm View Post
    I think the issue is your command line - and nothing to do with libmpc. You're certainly not using it.

    Try:
    Code:
    gcc hello.c -o hello
    Then try:
    Code:
    gcc -Wall hello.c -o hello
    and read the warnings.
    i m sorry the same issue : cc1: error while loading ..... cant op libmpc.so.2

  6. #6
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,293
    It looks to me like you have an installation issue then. You might need to run ldconfig.

    Try:
    Code:
    export LD_LIBRARY_PATH="/usr/lib";  sudo ldconfig

  7. #7
    Just Joined!
    Join Date
    Jun 2014
    Posts
    6
    the same as the latest , but i want to install a new gcc now.
    i download gcc-4.9.0.tar.bz2 to /opt , i have tar it and create a directory means /usr/local/gcc-4.9.0.
    the next commands is as follows :
    Code:
    cd opt/gcc-4.9.0;  ./contrib/download_prerequisites
    ./configure --prefix=/usr/local/gcc-4.9.0
    then there is an error message:
    Code:
    Checking for gcc.... gcc
    Checking for C Compliler Default  output file name...
    configure: error: in '/usr/local/gcc-4.9.0':
    configure: error: C Compiler can not Crete executables
    See 'config.log' for more details.

  8. #8
    Just Joined!
    Join Date
    Jun 2014
    Posts
    6
    has resolved. thank u @gregm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •