messed up with gcc! [Solved]

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

messed up with gcc! [Solved]

Postby fjkhf » Sat Dec 14, 2013 9:40

Hello,

I messed up gcc and now it is full of errors when compiling.

I removed
Code: Select all
sys-devel/base-gcc-4.6.4  sys-devel/gcc-4.6.4 sys-devel/gcc-4.7.3
(I couldn't remove gcc-4.7.3)

and I reinstalled.
I also chose gcc-4.6.4 (with gcc-config) ,and I did
Code: Select all
env-update && source /etc/profile


Also ,I did

Code: Select all
rm /usr/bin/g++
rm /usr/bin/gcc

ln -s /usr/bin/g++-4.6.4 /usr/bin/g++
ln -s /usr/bin/gcc-4.6.4 /usr/bin/gcc


but still the same problem.

My gcc doesn't work.

Any solotuions?

Thank you !

----------------UPDATE----------------------------------

I noticed something!

When I do which gcc as user returns
Code: Select all
 /opt/cuda/bin/gcc

ans as root returns
Code: Select all
/usr/bin/gcc
(also,trying as root to compile doesn't work either)

My bashrc has:
Code: Select all
export PATH=~/bin:$PATH
export PATH=/opt/cuda/bin:$PATH
export PATH=~/opt/bin:$PATH
export LD_LIBRARY_PATH=/opt/cuda/lib64:$LD_LIBRARY_PATH
export CUDA_ROOT=/opt/cuda/bin


What should I do?
Last edited by fjkhf on Thu Dec 19, 2013 13:58, edited 1 time in total.
fjkhf
Simple Hen
 
Posts: 97
Joined: Tue Jun 26, 2012 13:41

Re: messed up with gcc!

Postby Stupot » Sat Dec 14, 2013 17:51

Wait, so you removed
Code: Select all
sys-devel/base-gcc-4.6.4  sys-devel/gcc-4.6.4 s


And then reinstalled them?

Reinstalled them how? Portage or Entropy?

You shouldn't have to remove and set symlinks manually like you did. I'd imagine there's some set of eselect commands and others you should/could use instead. Such as "eselect env update" and stuff.


But I guess the real question I have is, what is it that you are actually attempting to accomlpish by this? Are you looking to use portage only and compile with gcc-4.6.4? If so, why? Let us know what your end goal is and perhaps we can find a better solution than changing your system's gcc (which is typically not a great idea, especially for portage based systems).
Stupot
Sagely Hen
 
Posts: 1546
Joined: Wed Feb 14, 2007 3:44
Location: St. Louis, MO, USA


Re: messed up with gcc!

Postby fjkhf » Sun Dec 15, 2013 18:49

Hello ,

I use entropy.I just removed and reinstalled in order to see if it works but it doesn't.

I used the symlinks because I thought this is the right thing to do.

I just want the compiler to work!

I don't have any erros to report ,just the compiler that doesn't understand the commands.

Thanks
fjkhf
Simple Hen
 
Posts: 97
Joined: Tue Jun 26, 2012 13:41

Re: messed up with gcc!

Postby fjkhf » Sun Dec 15, 2013 20:02

Also, notice that

When I do which gcc as user returns


Code: Select all
    /opt/cuda/bin/gcc



and as root returns


Code: Select all
  /usr/bin/gcc
fjkhf
Simple Hen
 
Posts: 97
Joined: Tue Jun 26, 2012 13:41

Re: messed up with gcc!

Postby Stupot » Tue Dec 17, 2013 5:57

Did you try reinstalling gcc (4.7.3)?

Just give
Code: Select all
#equo install gcc


a try if you haven't yet. That should redo the necessary sym linking necessary for it to work.
Stupot
Sagely Hen
 
Posts: 1546
Joined: Wed Feb 14, 2007 3:44
Location: St. Louis, MO, USA

Re: messed up with gcc!

Postby fjkhf » Tue Dec 17, 2013 21:59

Yes, I have gcc 4.7.3.

I can't understand why as user it gives me /opt/cuda/bin/gcc.

Isn't a way to change that?(if this is the problem,I don't know)
fjkhf
Simple Hen
 
Posts: 97
Joined: Tue Jun 26, 2012 13:41

Re: messed up with gcc!

Postby Stupot » Wed Dec 18, 2013 21:12

I know you have gcc 4.7.3. I'm asking you to reinstall it and see if that fixes anything for you.
Stupot
Sagely Hen
 
Posts: 1546
Joined: Wed Feb 14, 2007 3:44
Location: St. Louis, MO, USA

Re: messed up with gcc!

Postby fjkhf » Thu Dec 19, 2013 13:58

Finally , I again removed gcc and g++ , I reinstalled ,made the symlinks and now it works.
fjkhf
Simple Hen
 
Posts: 97
Joined: Tue Jun 26, 2012 13:41


Return to Beginners|Newbies Area

Who is online

Users browsing this forum: No registered users and 1 guest

cron