LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 10-14-2009, 04:10 AM   #1
Isuru Divarathne
LQ Newbie
 
Registered: Oct 2009
Posts: 9

Rep: Reputation: 0
Unhappy How to set the environment variable CC to a working compiler


following is the problem that I faced during the installation process of gcc-3.0.4
the steps I followed >>

* gunzip and tar -xf al gcc-3.0.4*.tar.gz files
* mkdir gcc-build;cd gcc-build
*then the following problem occured......

ot@localhost gcc-build]# /usr/gcc/gcc-3.0.4/configure --prefix=/opt-program-suffix=-3.0.4
Configuring for a i686-pc-linux-gnu host.
Created "Makefile" in /usr/gcc/gcc-build using "mt-frag"
/tmp/cNf3807/cNf3807.pos: line 7: cc: command not found
*** The command 'cc -o conftest -g conftest.c' failed.
*** You must set the environment variable CC to a working compiler.


prior to this we got these results

[root@localhost ~]# which gcc
/usr/bin/which: no gcc in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/libexec/gcc/i386-redhat-linux/3.4.3:/usr/java/jdk1.6.0_16/bin:/usr/apache-ant-1.7.1/bin:/root/bin)


[root@localhost ~]# set
ANT_HOME=/usr/apache-ant-1.7.1
BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="3" [1]="00" [2]="15" [3]="1" [4]="release" [5]="i386-redhat-linux-gnu")
BASH_VERSION='3.00.15(1)-release'
CC=gcc
COLORS=/etc/DIR_COLORS.xterm
COLORTERM=gnome-terminal
COLUMNS=80
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-9An1DiKmNp
DESKTOP_SESSION=default
DIRSTACK=()
DISPLAY=:0.0
EUID=0
GDMSESSION=default
GNOME_DESKTOP_SESSION_ID=Default
GNOME_KEYRING_SOCKET=/tmp/keyring-kLC8m2/socket
GROUPS=()
GTK_RC_FILES=/etc/gtk/gtkrc:/root/.gtkrc-1.2-gnome2
G_BROKEN_FILENAMES=1
HISTFILE=/root/.bash_history
HISTFILESIZE=1000
HISTSIZE=1000
HOME=/root
HOSTNAME=localhost.localdomain
HOSTTYPE=i386
IFS=$' \t\n'
INPUTRC=/etc/inputrc
JAVA_HOME=/usr/java/jdk1.6.0_16
KDEDIR=/usr
LANG=en_US.UTF-8
LESSOPEN='|/usr/bin/lesspipe.sh %s'
LINES=24
LOGNAME=root
LS_COLORS='no=00:fi=00:di=00;34:ln=00;36i=40;33:so=00;35:bd=40;33;01:cd=40;33;01r=01;05;37;41:mi =01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=0 0;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.g z=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00; 35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:'
MACHTYPE=i386-redhat-linux-gnu
MAIL=/var/spool/mail/root
MAILCHECK=60
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/libexec/gcc/i386-redhat-linux/3.4.3:/usr/java/jdk1.6.0_16/bin:/usr/apache-ant-1.7.1/bin:/root/bin
PIPESTATUS=([0]="0" [1]="0")
PPID=3757
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
PS1='[\u@\h \W]\$ '
PS2='> '
PS4='+ '
PWD=/root
RHINO_HOME=/usr/RhinoSDK
SESSION_MANAGER=local/localhost.localdomain:/tmp/.ICE-unix/3814
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=2
SSH_AGENT_PID=3844
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SSH_AUTH_SOCK=/tmp/ssh-MfaKTe3843/agent.3843
SUPPORTED=en_US.UTF-8:en_US:en
TERM=xterm
UID=0
USER=root
WINDOWID=35660772
XAUTHORITY=/root/.Xauthority
_
to my knowledge there is a previous version of gcc is installed in /usr/libexec/i386-......
so I set the environmental variable for the new gcc and don't know whether it has been correctly set .The above command would display all my efforts in setting up environmental variable and the following I tried after above stuff

[root@localhost gcc-build]# make
Configuring in ./libiberty
creating cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for ar... ar
checking for ranlib... ranlib
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH
make: *** [configure-target-libiberty] Error 1


[root@localhost gcc-build]# make install
/bin/sh /usr/gcc/gcc-3.0.4/mkinstalldirs /opt-program-suffix=-3.0.4 /opt-program-suffix=-3.0.4
mkdir /opt-program-suffix=-3.0.4


please anybody who got answers for the above situation reply immediately because we are stuck in the middle of a PROJECT AND IM AN APPRENTICER ...TO THIS FIELD
 
Old 10-14-2009, 08:38 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Isuru Divarathne View Post
following is the problem that I faced during the installation process of gcc-3.0.4
the steps I followed >>

please anybody who got answers for the above situation reply immediately because we are stuck in the middle of a PROJECT AND IM AN APPRENTICER ...TO THIS FIELD
We volunteer our time here, so don't tell us to hurry up and answer you. If you're an apprentice, that implies that you have someone mentoring/tutoring you....have you asked them???

You don't say what version/distro of Linux you have, but unless you HAVE a C compiler installed, you won't be able to compile ANYTHING using C. You can, however, use the online repos to install one. If you're using CentOS/Fedora, try "yum install gcc". A Debian based distro can use "apt-get".
 
  


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
Set environment variable prabuinet Linux - Newbie 2 12-07-2008 12:44 AM
how to set environment variable pranith Linux - Newbie 1 01-27-2005 11:23 PM
I getting the error you must set the environmnet variable to a working compiler Devo174 Linux - Laptop and Netbook 1 06-08-2004 11:40 AM
Must set the environment variable CC to a working compiler MrCarl Linux - Software 1 09-23-2003 02:26 PM
Urgent Help Needed! Error: Must set the environment variable CC to a working compiler MrCarl Linux - Software 3 09-22-2003 11:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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