microsoft / DirectXTK

The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing DirectX 11.x code in C++
https://walbourn.github.io/directxtk/
MIT License
2.55k stars 506 forks source link

Unresolved externals in DirectXTK #31

Closed AndreAhmed closed 8 years ago

AndreAhmed commented 8 years ago

Hi all, I'm using DirectXTK and I'm getting unresolved externals when I enable no intersincs, by defining the following #define _XM_NOINTRINSICS

unresolved external symbol "public: void __fastcall DirectX::SpriteBatch
walbourn commented 8 years ago

I do not provide a vcxproj for DirectXTK that is built with _XM_NO_INTRINSICS_. Since DirectXMath is an all inline header, it is important that all code in the same EXE/DLL built with the same build settings for it. To use _XM_NO_INTRINSICS_, you'd need to rebuild the DirectXTK library itself to use that setting.

That said, you really shouldn't have any reason to use _XM_NO_INTRINSICS_. If you need easy individual component access and/or automatic alignment handling, just use SimpleMath which is part of the DirectX Tool Kit. It provides constructors and implicit conversion operators which allows you to treat an XMVECTOR as if it were XMFLOAT4 or vice-versa.