Skip to main content
gamedev.net
🔒 Locked

example code problem

Started by Gametaku Jan 7, 2002 at 10:08 PM 1 replies 1.8k views
Original Post
Gametaku
Gametaku
ok I am trying to compile the Matrices.cpp example I get this: ! Error E2268 C:\DXSDK\include\d3dx8math.inl 1107: Call to undefined functi * on ''sqrtf'' in function D3DXVec2Length(const D3DXVECTOR2 *) ! Error E2268 C:\DXSDK\include\d3dx8math.inl 1239: Call to undefined functi * on ''sqrtf'' in function D3DXVec3Length(const D3DXVECTOR3 *) ! Error E2268 C:\DXSDK\include\d3dx8math.inl 1384: Call to undefined functi * on ''sqrtf'' in function D3DXVec4Length(const D3DXVECTOR4 *) ! Error E2268 C:\DXSDK\include\d3dx8math.inl 1554: Call to undefined functi * on ''sqrtf'' in function D3DXQuaternionLength(const D3DXQUATERNION *) Please help You are with me. Or you are not. The choice is yours. Witch shall you choose?
Just me
Gametaku
Gametaku
thats not it. I am using borland command line, I need to do what it says here, but with out Builer.


Talking about D3DFrame...you will come across one or two problems when trying to use d3dmath, d3dtextr, and friends.

The first one is the compiler complaining about undefined functions, namely "sinf", "cosf", "tanf", etc. These are special versions of the mathematical functions ("sin", "cos", "tan", etc.) that return floats. These functions do not exist in C++Builder, but you can safely cast the return values of the regular math functions to "float" to emulate them. It is best to add the following definition to your (global) project options ("Project | Options", "Folders and Definitions" tab):

"cosf=(float)cos;sinf=(float)sin;acosf=(float)acos;asinf=(float)asin;
tanf=(float)tan;atanf=(float)atan;sqrtf=(float)sqrt"

Alternatively, you can add #defines to the headers of the affected units.

Note: The cast to float does not lose any precision when compared to Visual C++ apps. They would have used floats in the first place...


any clue.


You are with me.
Or you are not.
The choice is yours.
Witch shall you choose?
Just me

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.