LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to install gcc when a current gcc is installed but not responding (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-install-gcc-when-a-current-gcc-is-installed-but-not-responding-761989/)

Nadishka 10-14-2009 11:10 PM

How to install gcc when a current gcc is installed but not responding
 
when i tried to install gcc-3.0.4 following problems are occured


* using tar zxvf extract gcc-3.0.4*.tar.gz files
* mkdir objdir;cd objdir
*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 reply to this.Thank you.

paulsm4 10-14-2009 11:21 PM

Dude, it doesn't sound like you've got gcc installed.

1. If you really think "gcc" is somewhere on your system, you can search for it with a brute-force method like this:
Quote:

find / -name gcc -print 2>/dev/null
2. The "/usr/gcc/gcc-3.0.4" you downloaded is apparently a *source* distribution. In other words, you need to build it. And of course, you can't build it (or anything else) without an existing compiler.

3. The *easiest* approach is to just download a binary gcc RPM. For example:

http://www.rpmfind.net/linux/rpm2htm....php?query=gcc

http://rpm.pbone.net/

'Hope that helps .. PSM

John VV 10-15-2009 02:23 AM

and WHY do you need such an OLD gcc( gcc-3.0.4) this in not even the legacy gcc3.4

even IF you manage to get that antique compiler installed i dought that ANYTHING you might be able to build will even run .

Gcc 4.4.1 is the current

Nadishka 10-15-2009 03:20 AM

while installing gcc 4.4.1 rpm i got following error
so i searched to download glibc-devel-2.3.4-2.19.i386.rpm
but it was not available..


[root@localhost tmp]# rpm -i gcc-4.3.0-8.i386.rpm
warning: gcc-4.3.0-8.i386.rpm: V3 DSA signature: NOKEY, key ID 4f2a6fd2
error: Failed dependencies:
binutils >= 2.17.50.0.17-3 is needed by gcc-4.3.0-8.i386
cpp = 4.3.0-8 is needed by gcc-4.3.0-8.i386
glibc-devel >= 2.2.90-12 is needed by gcc-4.3.0-8.i386
libc.so.6(GLIBC_2.4) is needed by gcc-4.3.0-8.i386
libgcc >= 4.3.0-8 is needed by gcc-4.3.0-8.i386
libgomp = 4.3.0-8 is needed by gcc-4.3.0-8.i386
libgomp.so.1 is needed by gcc-4.3.0-8.i386
rtld(GNU_HASH) is needed by gcc-4.3.0-8.i386
Suggested resolutions:
glibc-devel-2.3.4-2.19.i386.rpm

Can you help me with this...

lutusp 10-15-2009 04:03 AM

Quote:

Originally Posted by Nadishka (Post 3719978)
while installing gcc 4.4.1 rpm i got following error
so i searched to download glibc-devel-2.3.4-2.19.i386.rpm
but it was not available..


[root@localhost tmp]# rpm -i gcc-4.3.0-8.i386.rpm
warning: gcc-4.3.0-8.i386.rpm: V3 DSA signature: NOKEY, key ID 4f2a6fd2
error: Failed dependencies:
binutils >= 2.17.50.0.17-3 is needed by gcc-4.3.0-8.i386
cpp = 4.3.0-8 is needed by gcc-4.3.0-8.i386
glibc-devel >= 2.2.90-12 is needed by gcc-4.3.0-8.i386
libc.so.6(GLIBC_2.4) is needed by gcc-4.3.0-8.i386
libgcc >= 4.3.0-8 is needed by gcc-4.3.0-8.i386
libgomp = 4.3.0-8 is needed by gcc-4.3.0-8.i386
libgomp.so.1 is needed by gcc-4.3.0-8.i386
rtld(GNU_HASH) is needed by gcc-4.3.0-8.i386
Suggested resolutions:
glibc-devel-2.3.4-2.19.i386.rpm

Can you help me with this...

You don't say which distribution you are running, but either:

Code:

# yum install gcc
-- or --

Code:

# apt-get install gcc
Should work.

Nadishka 10-15-2009 04:19 AM

The Distribution is Red Hat Enterprise Linux AS4
and the above commands didn't work.!

John VV 10-15-2009 03:33 PM

use the rhel 4 command "up2date "

yum is used in rhel 5

for rhel 4 i think that gcc3.4 was the default
depending on when the last update from red hat was ( when did you stop paying red hat for updates) that might have been updated -- maybe-


All times are GMT -5. The time now is 08:33 PM.