LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 10: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, 01:59 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
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
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian
Posts: 448

Rep: Reputation: 37
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


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


All times are GMT -5. The time now is 02:39 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