Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-04-2008, 10:50 AM   #1
LQ Newbie
Registered: Jan 2008
Posts: 1

Rep: Reputation: 0
selecting gcc4 over gcc

Hi All
On our Red Hat Enterprise 4 machine we have two compilers installed. GCC version 3.4.6 which is installed as /usr/bin/gcc and /usr/bin/g++ and the newer GCC 4.1.0 which is installed as /usr/bin/gcc4 and /usr/bin/g++4.

As a total linux newbie I am attempting to build a program which requires the later compiler but the configure script always chooses the g++ compiler. Can anyone tell me how I go about specifying the later compiler and forcing the build to use gcc4?

Old 01-04-2008, 01:59 PM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
alias gcc=gcc4

should do it.

If that doesn't work for some reason, try

export CC=gcc4

before running make.

Last edited by btmiller; 01-04-2008 at 02:00 PM.
Old 01-04-2008, 02:38 PM   #3
Registered: May 2006
Location: UK
Distribution: Debian
Posts: 447

Rep: Reputation: 39
Essentially the same thing as btmiller said but you might want to run configure as:

CC=gcc4 ./configure --prefix=...[etc]
In this case CC=gcc4 is only valid for the one command. It saves you having to change CC or unset the alias later.


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
no GCC ? Only GCC4.1 knobby67 Programming 1 08-05-2007 02:21 PM
Help with gcc4.0 js72 Debian 4 01-03-2007 06:51 AM
how to uninstall gcc4.0.1? gepo Linux - Software 2 09-05-2005 09:50 AM
Is GCC4.0 necessary for Mplayer? jared78 Linux - Software 4 05-05-2005 04:19 PM
Gcc4 hgnoel1980 Linux From Scratch 2 04-29-2005 04:42 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:47 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
Open Source Consulting | Domain Registration