sqrtf ??
Due to buget reasons I am still codeing around with Visual C++ 4.0
I when ever I compile D3d8math.h, I get "can''t find function sqrtf". I added Math.h to the program. It did not work..
Anyone know where I can find that function?
It exists in Visual C++ 5 and 6 (well, not too sure about 5). You can get around it by putting #define sqrtf (float)sqrt in your source file or -Dsqrtf=(float)sqrt as a command line argument to the compiler. The latter is what the sdk makefile does for borland compilers (which also don''t have the sqrtf function).
This might have some of the info your looking for. d3dx8math and the sqrtf function. Hope this helps!
"I kinda think, therefore, I kinda... am?"
"I kinda think, therefore, I kinda... am?"
here''s the code.
hope this helps.
float sqrtf(float f){ float fResult; __asm { fld f fsqrt fstp fResult } return (fResult);}
hope this helps.
All those math functions (sinf, cosf, atan2f, sqrtf) are non-standard functions, which makes sharing code a pain in the butt. I work in Borland C++ Builder 5 and use code written with Visual C++ 6.0. I work around the problem of the missing functions by setting up macros to make them into standard functions.
#ifdef __BORLANDC__
#define sinf(x) (float)sin((float)x)
#define sqrtf(x) (float)sqrt((float)x)
#endif
There are many other annoyances when using Visual C++ code with a much stricter ANSI-compliant compiler such as Borland C++ 5.5, but I will let those pass for now.
Steve ''Sly'' Williams
Tools Developer
Krome Studios
#ifdef __BORLANDC__
#define sinf(x) (float)sin((float)x)
#define sqrtf(x) (float)sqrt((float)x)
#endif
There are many other annoyances when using Visual C++ code with a much stricter ANSI-compliant compiler such as Borland C++ 5.5, but I will let those pass for now.
Steve ''Sly'' Williams
Tools Developer
Krome Studios
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement