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
make sure that your libpath (in g++) points to the directory(ies) that libm.a and libc.a are located in (use the -L option)