When attempting to compile the newest version of S.M.A.R.T. Monitoring Tools on a CentOS Linux server I received an error complaining about the C++ compiler not being able to create executables. In the error output below you can see that the configure script complains of not being able to find a suitable compiler so it errors out.
How to Switch Between Different Versions of GCC and G++ in Backtrack 4 Final (Or Any Version Of Ubuntu)
I had a Backtrack user on IRC today asking about using different versions of GCC in Backtrack. Since Backtrack is based on Ubuntu Linux this article will apply to any version of Ubuntu but I wanted to write something specifically for Backtrack users. There are many reasons for needing different versions of GCC and G++. One of the main ones is installing a program which requires a kernel module to be built. What happens is that if the kernel was built with GCC-4.1 and GCC has since been updated to GCC-4.3 sometimes the build will fail dude to a kernel/GCC –version mismatch. Below I detail the steps to downgrade from GCC-4.3 to GCC-4.1 on Backtrack Linux.
You might see this error when attempting to install various packages or gems on CentOS Linux. I noticed it when attempting to install the ruby gem named eventmachine. After installing one RPM package via yum I no longer received the error when attempting to install the eventmachine gem.