"Could someone help me understand the relationship between gcc and glibc. Do you need compatible versions(gcc and glibc) on your system so you are able to compile programs? "
Yes. When gcc compiles source code it sets up links to standard subroutines in glibc. The subroutines in glibc change from time to time. When the parameter list for a called glibc subroutine changes then gcc has to be changed to set the parameter list up the same way. So glibc and gcc tend to be released in matching releases.
The relationship to libraries other than glibc is different. For other functions the programmer has to tell gcc to include the function in the compile. Also the programmer has to specify the parameter list for each function call. gcc does not need built in knowledge about the functions explicitly defined by the programmer so these functions are gcc version independent.
Be prepared. Create a LifeBoat CD.