#1581 - DennisBor - Mon Jan 20, 2003 2:26 pm
I'm trying to rotate my sprites and the tutorial from the PERN project sais I have to use the math functions.
I'm using the code below for the functions:
The problem is that the compiler complains:
undefined reference to 'sin'
undefined reference to 'cos'
does anyone know how to fix this compiler error?
Dennis
_________________
I rather have a compiler than a girl... A compiler isn't complaining all the time!
I'm using the code below for the functions:
Code: |
#include "math.h" // maak een macro voor FIXED getallen (zonder komma) #define FIXED unsigned long //maak een macro voor de waarde van PI #define PI 3.14159 // maak een macro om de #define RADIAAL(myWaarde) (((float)myWaarde)/(float)180*PI) // [CUT] A LOT MORE CODE... [/CUT] // loop to save all 360 cos and sin values for (myLoop = 0; myLoop < 360; myLoop ++) { mySinus[myLoop] = (FIXED)(sin(RADIAAL(myLoop)) * 256); myCosinus[myLoop] = (FIXED)(cos(RADIAAL(myLoop)) * 256); } |
The problem is that the compiler complains:
undefined reference to 'sin'
undefined reference to 'cos'
does anyone know how to fix this compiler error?
Dennis
_________________
I rather have a compiler than a girl... A compiler isn't complaining all the time!