[Bug 60749] Do not need to link against -lm for fabs*()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=60749

--- Comment #1 from Jeyaram <rjayavrp2@xxxxxxxxx> ---
Following code also works fine without linking with -lm

#include <math.h>
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv)
{
   printf("%lf\n", pow(5,3));
   return 0;
}

Actually, libc some how includes the math library
"/lib/i386-linux-gnu/libm.so.6".

If this file is not available, then following error message is displayed.

/usr/lib/gcc/i686-linux-gnu/4.7/cc1: error while loading shared libraries:
libm.so.6: cannot open shared object file: No such file or directory

I tried it by renaming libm.so.6. 

Solution:

I request not to remove the line "Link with -lm". This is mandatory.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux