LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-20-2012, 10:55 AM   #1
kareempj
LQ Newbie
 
Registered: Mar 2012
Posts: 18

Rep: Reputation: Disabled
Gcc compiler not finding object files


Hey guys, I am having another problem with my gcc compiler. I has been installed correctly yet when I try to compile I keep getting this error:

/export/software/gcc-4.5.1/libexec/gcc/x86_64-unknown-linux-gnu/4.5.1/f951: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory

However when I go to that location I am seeing the libmpc.so.2 file so I am wondering why I keep getting this error when trying to compile!

Please any help given will be greatly appreciated
 
Old 04-20-2012, 11:07 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,438

Rep: Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770
can you show us the full command? Maybe a -L flag is missing.
 
Old 04-20-2012, 12:02 PM   #3
kareempj
LQ Newbie
 
Registered: Mar 2012
Posts: 18

Original Poster
Rep: Reputation: Disabled
The command I am issuing is gcc test.c, where test is a simple hello world program!
 
Old 04-20-2012, 12:08 PM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,438

Rep: Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770
there is a libmpc related package. I do not know your os, but I think this package is missing.
 
Old 04-20-2012, 03:18 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,107

Rep: Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478
what operating system is this and HOW did you install gcc

for example :
IF this is a red hat based os like fedora
you NEED to install the development group and the development libraries
not just gcc ONLY

without knowing the needed information all i can say is

install the development environment for your distro
how you do that depends on what you are using
 
Old 04-21-2012, 12:00 AM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
If your libraries are in a non-standard location (i.e. not /usr/lib, /usr/lib64 or the like) you need to set LD_LIBRARY_PATH to point to them, e.g.:

export LD_LIBRARY_PATH=/export/software/gcc-4.5.1/lib64 # note (change lib64 to lib if on a 32 bit system).

To make ld always search in a particular directory for libraries, you can modify /etc/ld.so.conf.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] gcc compiler is not compiling old C Programming files beacuse of timestamp issue aanand0 Linux - Newbie 15 11-23-2010 06:58 AM
configure not finding ansi c compiler even though I have gcc installed lilmike Linux - Newbie 5 11-02-2009 06:18 PM
GCC error cannot compute suffix of object files orcaja Linux - Software 1 08-25-2008 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration