Thursday, 27 December 2012

How to compile C programs that include trigonometry or math functionality such as sin, cos() and tan()


With some gcc installations (e.g. on my Raspberry Pi) then you need to include the math library (-lm) in the link process :
gcc -Wall program.c -o program -lm

No comments:

Post a Comment