GCC link time errors calling trig functions

Robert Parker rlp1938 at gmail.com
Sat Jan 28 12:35:37 UTC 2006


I'm answering my own post just in case it helps someone else.

On 1/28/06, Robert Parker <rlp1938 at gmail.com> wrote:
> System:
> Kubuntu 5.1 amd64
> gcc version:
> gcc (GCC) 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)
>
> bob at johnket5:~/projects/plate_and_sheet$ gcc -Wall -o pands pands.c
> /tmp/cckui0iR.o: In function `dome':
> pands.c:(.text+0x6aa): undefined reference to `cos'
> collect2: ld returned 1 exit status
>
> What library do I need to link?
>
> Thanks
> Bob Parker

The library is libm and it is used thus:
                gcc -Wall -o pands pands.c -lm

and I found the information at:
http://refspecs.freestandards.org/LSB_2.1.0/LSB-Core-generic/LSB-Core-generic/generic-lsb.html

Bob Parker




More information about the kubuntu-users mailing list