问题
#include<iostream>
#include<string.h>
#include<Windows.h>
.
.
.
using namespace Windows::Networking::Connectivity;
.
.
.
ConnectionProfile^ internetConnectionProfile = NetworkInformation::GetInternetConnectionProfile();
.
.
.
The above is the code but it is showing
error C2653: 'Windows' : is not a class or namespace name
What do I do? Common Language Runtime Support(/clr) is set
回答1:
I think you want to use C++/CX (not C++/CLI). The languages are practically identical (in terms of how their syntax looks). But building them is not the same: you enable C++/CX by using the /ZW compiler option (which is turned on by default when you create a Windows Store App).
In the UI, the /ZW option is listed as "Consume Windows Runtime Extension"
See:
http://msdn.microsoft.com/en-us/magazine/dn166929.aspx
来源:https://stackoverflow.com/questions/16698949/how-to-access-namespace-windows