c++visual-studio-2019nuget-packagedirect3ddirectxtk

LNK1104 with NuGet Packages : DirectXTKAudioWin8.lib


I have a Direct3D Application.

We use the NuGet Package directxtk_desktop_2015. In recent packages like directxtk_desktop_win10 or directxtk_uwp, I have additional WICTextureLoader flags which I want and need. However, when I add these packages to NuGet, I receive the linker error

LINK : fatal error LNK1104: cannot open file 'DirectXTKAudioWin8.lib'

How can I resolve this? This is my current packages.config:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="directxtk_desktop_win10" version="2020.8.15.1" targetFramework="native" />
</packages>

Solution

  • You should use only one of those packages at a time. If you are currently using directxtk_desktop_2015 and you are using VS 2019, then you should use directxtk_desktop_2017 instead.

    I dropped VS 2015 support and deprecated directxtk_desktop_2015 starting with the February 2020 release

    The directxtk_desktop_2015 package only included the Windows 8+ version of DirectX Tool Kit for Audio, but with directxtk_desktop_2017 I switched to using the XAudio2Redist which supports Windows 7 SP1 or later. If you only require Windows 10 or later support, then use directxtk_desktop_win10 instead. For UWP apps (i.e. not Win32 desktop apps), you'd use directxtk_uwp.

    See the wiki for more details.

    UPDATE: In this case, the problem was .vcxproj was not fully cleaned up to remove the references to directxtk_desktop_2015. Opening the vcxproj in a text editor and verifying which targets are being referenced found this issue.