Reputation: 39
I want to build up a DirectX project
but when I press build on vs 2017, it keeps showing
Error LNK1104 cannot open file 'D3D10.lib & D3DX10.lib'
I google it but have no answer on it, what should I do?
spec list of my computer Windows 11 VS 2017
Upvotes: 0
Views: 448
Reputation: 41067
Visual Studio 2017 comes with the Windows 10 SDK. This includes DirectX headers, libs, and the shader compiler for Direct3D 9, Direct3D 10.x, Direct3D 11.x, and Direct3D 12.
d3d10.lib
and d3d10_1.lib
are in the Windows 8.x SDK and Windows 10 SDK.
The D3DX utility library (d3dx9.lib
, d3dx10.lib
, and d3dx11.lib
) are not in the Windows SDK. This legacy DirectX SDK library has been deprecated and was not carried forward past the end-of-life for the DirectX SDK.
The primary recommendation here would be to use Direct3D 11 and not use Direct3D 10. There's no technical reason why you'd want to use Direct3D 10 (unless you had to support Windows Vista RTM or Windows Vista SP1). Direct3D 11 has much better utility support, tutorials, and hardware support.
If you really need to use the legacy D3DX9, D3DX10, or D3DX11 libraries for some reason, the best option is to use the Microsoft.DXSDK.D3DX NuGet Package. See this blog post.
While it is possible to configure your build to use the Windows SDK in VS 2017 with the legacy DirectX SDK, there are a lot of quirks and known issues there. It's best to just ignore that and use the NuGet package instead.
For more details see Microsoft Docs and Living Without D3DX
Upvotes: 1