LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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-03-2011, 10:49 PM   #1
prakasha.lunux
LQ Newbie
 
Registered: Jan 2011
Posts: 25

Rep: Reputation: 0
Smile *** You must set the environment variable CC to a working compiler.


Hi ...

Currently I have gcc version 3.4.5. I need gcc 3.4.2 ... so I tried installing it. while doing configure i got error saying

" command not found
*** The command 'x86_64-host_redhat-linux-gcc -o conftest -g -O2 conftest.c' failed.
*** You must set the environment variable CC to a working compiler."
Can any one help me out ....

Thanks in advance

Regards
Prakash
 
Old 01-03-2011, 11:38 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Q: You need to get GCC 3.4.2, so you downloaded the source, and you're trying to use your existing GCC 3.4.5 compiler to build it, correct?

Q: The first step to building 3.4.2 is to run "./configure", and that's where you got the error "" command not found", correct?

Suggestions:
1. It would be easier if you could simply find a 3.4.2 binary for your system. For example, an .rpm. Please try that, OK?

2. Otherwise, please confirm that you actually HAVE a viable compiler. Type this, and cut/paste the output:
Quote:
gcc --version

whereis gcc
3. Finally, look at the comments at the top of your "configure" script (or at the README that accompanies it) and see if it takes any command line arguments that might help.

4. Please post back what you find. Please cut/paste exact commands and exact messages.
 
Old 01-04-2011, 04:43 AM   #3
prakasha.lunux
LQ Newbie
 
Registered: Jan 2011
Posts: 25

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by paulsm4 View Post
Hi -

Q: You need to get GCC 3.4.2, so you downloaded the source, and you're trying to use your existing GCC 3.4.5 compiler to build it, correct?

Q: The first step to building 3.4.2 is to run "./configure", and that's where you got the error "" command not found", correct?

Suggestions:
1. It would be easier if you could simply find a 3.4.2 binary for your system. For example, an .rpm. Please try that, OK?

2. Otherwise, please confirm that you actually HAVE a viable compiler. Type this, and cut/paste the output:

3. Finally, look at the comments at the top of your "configure" script (or at the README that accompanies it) and see if it takes any command line arguments that might help.

4. Please post back what you find. Please cut/paste exact commands and exact messages.

Hi paulsm..

Yes you are correct.
Thanks alot for your suggestion..

here is the output

snb022:srcdir# gcc --version
gcc (GCC) 3.4.5
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

snb022:srcdir# whereis gcc
gcc:

it just displaying nothing..

I checked for .rpm file.. I could not find exact version of .rpm file. Can you give me any suggestions...

Thanks..
Prakash

Last edited by prakasha.lunux; 01-04-2011 at 04:49 AM.
 
Old 01-04-2011, 07:39 AM   #4
ashish_neekhra
Member
 
Registered: Nov 2007
Posts: 67

Rep: Reputation: 4
Quote:
Originally Posted by prakasha.lunux View Post
Hi paulsm..

Yes you are correct.
Thanks alot for your suggestion..

here is the output

snb022:srcdir# gcc --version
gcc (GCC) 3.4.5
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

snb022:srcdir# whereis gcc
gcc:

it just displaying nothing..

I checked for .rpm file.. I could not find exact version of .rpm file. Can you give me any suggestions...

Thanks..
Prakash

Hi Prakash

You should get output of "whereis gcc" somthing like this,


Code:
[root@km-vmqa-dhcp187 ~]# whereis gcc
gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz
[root@km-vmqa-dhcp187 ~]#
Can you run this command,

Code:
[root@km-vmqa-dhcp187 ~]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@km-vmqa-dhcp187 ~]#

are you getting path as above ?

Btw what OS you have ? If you are not getting output as above then you have to set PATH variable.

#export PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

Only if you are Using CentOS, Fedora Or RedHat.

Last edited by ashish_neekhra; 01-04-2011 at 07:43 AM.
 
Old 01-04-2011, 11:23 AM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Quote:
gcc --version
gcc (GCC) 3.4.5
This confirms you have gcc installed (specifically, gcc 3.4.5). Good
Quote:
whereis gcc
gcc:

it just displaying nothing..
Not good . That's precisely why "config" is failing - because it can't find gcc.

Please try ashish_neekhra's suggestions:
Quote:
1. Type "echo $PATH". Cut paste the results.

2. Here is one way to find "gcc" (so you can add it to your $PATH):
find / -name gcc -print 2> /dev/null

3. Tell us what distro and version you're using.
One command might be "cat /etc/*release*".
Another is "uname -a"

4. Is your version 64-bit or 32-bit?
Do you need to compile for 32-bit, 64-bit ... or does it not matter?
 
Old 01-05-2011, 04:25 AM   #6
prakasha.lunux
LQ Newbie
 
Registered: Jan 2011
Posts: 25

Original Poster
Rep: Reputation: 0
Hi thanks ashish_neekhra & paulsm...

@ ashish_neekhra, echo $PATH giving result as
snb022:core# echo $PATH
/usr/local/bin/svos:/usr/local/bin64:/usr/local/bin64/numa:/usr/local/bin:/usr/local/bin/numa:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/boxboroex/bin:/usr/local/tylersburg/bin:/usr/local/rcf/tbg/bin:/usr/local/python/boxboroex/bin:/usr/local/python/bin:/usr/local/bin:/usr/local/bin/alchemy:.:/root/bin:/usr/local/boxboroex/bin:/usr/local/tylersburg/bin:/usr/local/python/boxboroex:/usr/local/python/tylersburg:/usr/local/python/bin:/usr/local/bin/alchemy

and I tried exporting the gcc path it is giving error : "-bash: date: command not found"

and I have redhat OS.

@ paulsm.. It is 64 bit OS. and

I am using Red Hat Linux release 7.0 (Guinness)




Thanks
Prakash

Last edited by prakasha.lunux; 01-19-2011 at 03:58 AM.
 
  


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
How to set the environment variable CC to a working compiler Isuru Divarathne Linux - Software 1 10-14-2009 09:38 AM
I getting the error you must set the environmnet variable to a working compiler Devo174 Linux - Laptop and Netbook 1 06-08-2004 12:40 PM
Must set the environment variable CC to a working compiler MrCarl Linux - Software 1 09-23-2003 03:26 PM
Urgent Help Needed! Error: Must set the environment variable CC to a working compiler MrCarl Linux - Software 3 09-23-2003 12:42 AM


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