I am using ubuntu and gcc and g++ were working fine but today it showed:
cannot find -lm cannot find -lc
I searched and found it has something
the compiler cannot find static glibc, you might have installed only shared libraries try yum install glibc-static