How to link

Feb 28, 2013 at 1:41 PM
Edited Feb 28, 2013 at 1:49 PM
I'm trying to use DirectXTK in one of my (WinRT / C++Cx) project.

Previously I inserted the file of interest in my project.

Just now I try to add the DirectXTK project to the solution and add the DirectXTK to my WinRT C++CX component's dependencies. (Common properties: project and reference)

I added this project: 'DirectXTK_Windows8' which compile as a static library.

Once I do that and recompile my dependent C++/Cx component I got the following compilation error:

1>------ Build started: Project: DXBase, Configuration: Debug Win32 ------
1> pch.cpp
1>c:\dev\winrtdirectxsamples\dxbase\pch.cpp : fatal error C1192: #using failed on 'C:\Dev\WinRTDirectXSamples\DirectXTK\Bin\Windows8\Win32\Debug\DirectXTK.winmd'

1> 'The system cannot find the file specified.'

Now, why does it try to use a .winmd?!? I want a static library :/

Now, when I look at the property of the 'DirectXTK_Windows8' I see it has 'Windows Store support', could it be the problem that make this static lib useless??

In the mean time I just link, build and run successfully with 'DirectXTK_Desktop_2012'

what's the point of the 'DirectXTK_Windows8' project???
Feb 28, 2013 at 9:39 PM explains how to set this up:

In your application's solution, right-click on the Solution and use "Add \ Existing Project..." to add the appropriate .vcxproj file to your solution.
  • DirectXTK_Windows8 is for Windows Store apps building with VS 2012
  • DirectXTK_WindowsPhone8 is for Windows phone 8 apps building with VS 2012 and the Windows Phone 8.0 SDK
  • DirectXTK_Desktop_2012 is for Win32 desktop applications building with VS 2012 Express for Desktop, VS 2012 Professional or higher
  • DirectXTK_Desktop_2010 is for Win32 desktop applications building with VS 2010 using the Windows 8.0 SDK
In your application's project, right-click on the Project and use "References...", then "Add New Reference...", and then check the DirectXTK project name and click OK.

For a Windows Store app, you need to set Reference Assembly Output to false since DirectXTK is a static C++ library and not a WinRT component.

In your application's project settings, on the "C++ / General" page set Configuration to "All Configurations", set Platform to "All Plaforms", and then add the relative path to DirectXTK\inc; to the Additional Include Directories properties. Click Apply.