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 to do with /usr/bin/ld
. Which is a symlink (I hope) to lbd.bdf
. I pasted that file in the directory from Ubuntu of some friends PC. It didn't work.
I found that -lc
means include static library libc.a.
similarly for -lm
I found them in my i386-linux-folders
(name was something different).
I tried code blocks but same errors.
The compiler cannot find static glibc, you might have installed only the shared libraries, try:
yum install glibc-static
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With