-lm and -lm64 problems

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

 



Hi,

I wrote a simple C script in which sqrt() is used. The program
compiles fine on Debian i686; however, on Ubuntu 11.10 AMD64, it can't
be compiled:

1) if I compile it as 'gcc -Wall -g -m64 -lm64 -o foo foo.c', it complains:
/usr/bin/ld: cannot find -lm64
collect2: ld returned 1 exit status

2) if I compile it as 'gcc -Wall -g -m64  -o foo foo.c', or 'gcc -Wall
-g -m32 -lm -o foo foo.c', it complains:
/dir/to/foo.c:15: undefined reference to `sqrt'
collect2: ld returned 1 exit status

Can someone offer me a hint? Thanks.

Kind regards,

Xianwen

--
Please notice that my previous email address v9@xxxxxx is no longer accessible.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux