LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 01-04-2008, 09:50 AM   #1
leone8
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?

Thanks
 
Old 01-04-2008, 12:59 PM   #2
btmiller
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 01:00 PM.
 
Old 01-04-2008, 01:38 PM   #3
Daws
Member
 
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:

Code:
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.
 
  


Reply



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

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

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