how to access namespace “windows”

眉间皱痕 提交于 2019-12-10 21:57:08

问题


#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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!