ok
In which linux flavour you are working ?
Ricky is Right , It may be possible the Enviornment Variables are not properly Set.
Firs of all find gcc executable i.e by this command
#find / -name gcc*
After that if gcc compiler is there is shows its location.., then Set PATH variable to that location
Gaurav