我正在尝试使用Microsoft Visual C++构建一个hello-world C++应用程序。MS Visual C++的标准包含路径是什么?
#include <iostream>
int main() {
std::cout << "Hello, world. " << std::endl;
return 0;
}
我得到这个错误:
main.cpp(1): fatal error C1083: Cannot open include file: 'iostream': No such file or directory
是什么标准包括了微软的Visual C++的路径?
注:我在命令行建设,而不是从Visual Studio
https://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx –
Visual C++命令行构建工具需要几个环境变量。我建议使用安装时包含的Visual Studio Developer Command提示符。否则,请查看DevEnv命令行开关。提示:显示您正在运行的命令的示例。 – geekonedge
iostream的路径应该在你的项目的属性 - 菜单项目>属性/配置属性/ VC++目录 - 条目“包含目录”应该包含'$(VC_IncludePath)',这反过来应该是'C: \ Program Files文件(x86)\ Microsoft Visual Studio 12.0 \ VC \ include' - 您可以检查其值,在右侧的小下拉列表中选择“编辑...”。它应该不会是一个问题,如果你使用各自的向导创建你的项目, – sergiol