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
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Unresolved External HB_FUN_SIN / HB_FUN_COS
Unresolved External HB_FUN_SIN / HB_FUN_COS
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
> 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
Thanks Jose, it worked very well.
Regards,
Juliano
Regards,
Juliano