Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-07-2006, 08:45 AM   #1
Registered: Oct 2005
Location: Hungary
Distribution: FC6 , freeBSD
Posts: 87

Rep: Reputation: 15
How to tell a package what gcc version to use?

Hi All!

I have Fedora3 on my box, with gcc-4.1.1 installed.
I want to install MPlayer, which compiles only with 3.x.x gcc compilers, but other stuff need the gcc-4.1.1.
I compiled gcc-3.4.4 to /opt/gcc3, but I cannot find a way to tell MPlayer's configure script to use this one.
Is tehere a way to make it use the version I installed at /opt/gcc3?

Any help would be appreciated!

Old 06-07-2006, 09:16 AM   #2
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,192

Rep: Reputation: 339Reputation: 339Reputation: 339Reputation: 339
You could try setting some enironmental variables before compiling (I don't know if MPlayer will honor them however):
# CC=/usr/bin/gcc-3.3
# export CC
If that doesn't work, you could brute force some symlinks to point to the compiler you want. On my system, /usr/bin/gcc is just a symlink to /usr/bin/gcc-4.0 Similar link exists for gccbug. I have removed these symlinks and recreated new ones pointing to older compiler version in the past, and this worked for me.

Here's what the compiler looks like in my /usr/bin. You can see the symlinks illustrated:
$ cd /usr/bin
$ pwd
$ ls -l gcc*
lrwxrwxrwx 1 root root     7 2006-01-15 10:58 gcc -> gcc-4.0
-rwxr-xr-x 1 root root 81072 2005-12-23 19:20 gcc-3.3
-rwxr-xr-x 1 root root 89136 2005-12-01 17:12 gcc-4.0
lrwxrwxrwx 1 root root    10 2006-01-15 10:58 gccbug -> gccbug-4.0
-rwxr-xr-x 1 root root 15963 2005-12-23 19:15 gccbug-3.3
-rwxr-xr-x 1 root root 16239 2005-12-01 17:06 gccbug-4.0
Below you can see how I required g++ version 3.3 back in January to compile something. My symlink is still pointing to the older compiler. I guess I should fix that now, but it conveniently illustrates what I'm recommending. If I remember correctly on that January compile, I could redirect to the older version of gcc using the CC enviroment variable, but I had to brute-force the g++ redirect using the symlink trick. Just don't forget to undo it after you're done (I should talk - it's obvious I forgot to undo mine!):
$ ls -l g++*
lrwxrwxrwx 1 root root     7 2006-01-08 20:47 g++ -> g++-3.3
-rwxr-xr-x 1 root root 84720 2005-12-23 19:20 g++-3.3
-rwxr-xr-x 1 root root 93008 2005-12-01 17:10 g++-4.0

Last edited by haertig; 06-07-2006 at 09:18 AM.


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
Regarding distribution + kernel version + gcc version + glib version. JCipriani Linux - General 8 04-19-2008 02:54 PM
help, gcc version and kernel version mismatch akanitkar Linux - Newbie 1 05-06-2006 07:02 AM
redhat fedora gcc version (compiled for 2.4.20) doesn't match kernel version 2.4.22 start1000 Linux - Software 0 03-16-2004 08:17 PM
export CC=/usr/bin/gcc-3.2 - switch gcc version? ferreter Linux - Software 1 08-20-2003 12:07 AM
Sample Driver Module incompatibility with Kernel version (or gcc version) jvs Linux - General 1 06-07-2002 01:40 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:18 AM.

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