Resolving Link Errors with D3DX Math Functions
The D3DX math functions are implemented identically in D3DX10 (D3DX10math.h) and D3DX9 (D3DX9math.h). This can cause link errors if a project implements both DirectX 9 and DirectX 10 code, and attempts to link a function from one header with the opposite library.
To eliminate the problem of including both headers, D3DX10math.h includes the following #define:
#ifndef __D3DX9MATH_H__
#define __D3DX9MATH_H__
To eliminate possible link errors, the DX SDK samples link to D3DX9 libraries first (D3DX9d.lib and D3DX9.lib) and then the D3DX10 libraries second (D3DX10d.lib and D3DX10.lib). These settings are under Project/Properties if you are using Visual Studio.