gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > "undefined reference to `sin' " why?

#6627 - syscan - Sat May 31, 2003 6:43 am

compile the .c file

#include <math.h>
SIN[loop] = (FIXED)(sin(RADIAN(loop)) * 256);

but error is :

undefined reference to `sin'
NMAKE : fatal error U1077: 'c:\devkitadv\bin\ld' : return code '0x1'

devkitadv 5 + vc6.0

#6629 - Daikath - Sat May 31, 2003 7:56 am

You need a certain commandline option to turn on the math library.
_________________
?There are no stupid questions but there are a LOT of inquisitive idiots.?

#6630 - syscan - Sat May 31, 2003 8:29 am

how can i do it ?


thx~~~~~~

#6633 - syscan - Sat May 31, 2003 10:55 am

-lm option is must be put


everything is OK!!!!