I am trying to work with a kinect 2 in c++. All the code samples I have seen use the WindowsPreview namespace but I don't seem to have access to it. I have the SDK (code samples run fine). I have correctly linked to the Kinect.h and kinect20.lib files. Can someone help me out?

WindowsPreview::Kinect is the namespace when using the Kinect API for the Windows Store, the other APIs use Microsoft::Kinect.
Found a mention of the namespaces in one of the videos: Kinect Data Sources and Programming Model (starts at 20:00)
It appears to be listed as WindowsPreview.Kinect in the documentation but in my code (not targetting the Windows store) it shows up as Microsoft.Kinect:
In my opinion, this is something that could be more clearly documented, but it is possible I'm just not looking in the right places.