Página 1 de 1

Unresolved External HB_FUN_SIN / HB_FUN_COS

Publicado: Mar Nov 08, 2011 6:32 pm
por emeasoft
Hello Xailers,
I need to use the functions to calculate sine and cosine of an angle, SIN() and COS().
But it is giving the errors unresolved external 'HB_FUN_SIN' and
unresolved external 'HB_FUN_COS'
Does anyone knows if there is a way to make it work or if exists another function to calculate the sine and cosine?
Thanks,
Juliano

Unresolved External HB_FUN_SIN / HB_FUN_COS

Publicado: Mar Nov 08, 2011 7:30 pm
por jfgimenez
Juliano,
> I need to use the functions to calculate sine and cosine of
> an angle, SIN() and COS().
>
> But it is giving the errors unresolved external 'HB_FUN_SIN'
> and
> unresolved external 'HB_FUN_COS'
>
> Does anyone knows if there is a way to make it work or if
> exists another function to calculate the sine and cosine?
Add this to your code:
//---------------------------------------------------------- --------------------
#pragma BEGINDUMP
#include "Windows.h"
#include "Xailer.h"
#include "math.h"
XA_FUNC( SIN )
{
hb_retnd( sin( hb_parnd( 1 ) ) );
}
XA_FUNC( COS )
{
hb_retnd( cos( hb_parnd( 1 ) ) );
}
#pragma ENDDUMP
//---------------------------------------------------------- --------------------
BTW, according to BCC++ docs, the arguments to both functions must by
expressed in radians.
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info

Unresolved External HB_FUN_SIN / HB_FUN_COS

Publicado: Mar Nov 08, 2011 7:49 pm
por emeasoft
Thanks Jose, it worked very well.
Regards,
Juliano