Jump to content
  • Advertisement
Sign in to follow this  
L. Spiro

Missing Namespaces on Windows 8.1 Target/Visual Studio 2017.

This topic is 478 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I haven’t touched Windows development since Windows Vista, and I have only worked with the Win32 API (not MFC or etc.)

I got a project from online that was made for Visual Studio 2015 and up to Windows 8.1, but I see no reason I should not be able to compile it with Visual Studio 2017 (I am running Windows 10 but I don’t think it was re-targeted towards Windows 10 during the project upgrade).

But it gives me this error:

using Microsoft::WRL::ComPtr; // Error	C2653	'Microsoft': is not a class or namespace name

Obviously searching for what I need to #include to get a namespace called “Microsoft” is useless—the returns are just MSDN articles explaining what namespaces are as it is not clever enough to realize I am telling it that the namespace is named Microsoft.

So clearly I am missing some #include but this is a bit baffling as the project should just work.  My research shows this is part of a “Universal” framework.  I’ve spent the last 4 hours adding all the optional components to Visual Studio 2017 that could possibly be related and nothing fixes it.

What the hell is this, what is the missing #include, and what the hell components do I need in Visual Studio 2017?


L. Spiro

Edited by L. Spiro

Share this post


Link to post
Share on other sites
Advertisement

Try this:

#include <wrl.h>

ComPtr isn't strictly a part of the Universal Windows framework, it's actually a part of the Windows Runtime C++ template library. I've used it for storing references to D3D11 COM objects even when using Win32. It should come as part of the Windows SDK.

More info can be found here: https://msdn.microsoft.com/en-us/library/hh438466.aspx

The reference for the class is here:  https://msdn.microsoft.com/en-us/library/br244983.aspx

Edited by Oberon_Command

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!