简体   繁体   English

Visual Studio 2010找不到<iostream>

[英]Visual Studio 2010 can't locate <iostream>

I just installed Visual Studio 2010 and I have a feeling something went pretty awry while I was installing it. 我刚刚安装了Visual Studio 2010,感觉安装时有些不对劲。 I have the following code return an error stating that it can't find the <iostream> file. 我有以下代码返回错误,指出它找不到<iostream>文件。 I looked in the includes folder (C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\include) and I only saw 4 files (omp.h, pgobootrun.h, srv.h, wmiatlprov.h). 我查看了include文件夹(C:\\ Program Files(x86)\\ Microsoft Visual Studio 10.0 \\ VC \\ include),仅看到4个文件(omp.h,pgobootrun.h,srv.h,wmiatlprov.h)。 I'm not sure if that's normal, but I'm 99% sure it's not. 我不确定这是否正常,但我99%的确定那不是正常的。

Here's my code: 这是我的代码:

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello, World!";
    return 0;
}

Which returns the following errors: 返回以下错误:

1>------ Build started: Project: Test2, Configuration: Debug Win32 ------
1>Build started 06/11/2012 0:31:05.
1>PrepareForBuild:
1>  Creating directory "c:\users\jake\documents\visual studio 2010\Projects\Test2\Debug\".
1>InitializeBuildStatus:
1>  Creating "Debug\Test2.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1>  Test2.cpp
1>c:\users\jake\documents\visual studio 2010\projects\test2\test2\test2.cpp(2): fatal error C1083: Cannot open include file: 'iostream': No such file or directory
1>  stdafx.cpp
1>c:\users\jake\documents\visual studio 2010\projects\test2\test2\stdafx.h(10): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
1>  Generating Code...
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.65
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

No matter how many Google searches I make I can't figure out how to resolve the issue. 无论我进行了多少次Google搜索,我都不知道如何解决该问题。 Any help is appreciated. 任何帮助表示赞赏。 If any more detail is needed, I can provide anything required for solving this, thank you. 如果需要更多详细信息,我可以提供解决此问题所需的任何信息,谢谢。

EDIT 1: I'm not using a precompiled header. 编辑1:我不使用预编译的标头。 I downloaded it from the MSDN website on a page I can't post here because it's tied to the account, but I definitely didn't run out of room (I have around 650 GB free on my hard drive). 我从MSDN网站上下载了它,因为它与帐户绑定,因此无法在此处发布该页面,但是我肯定没有足够的空间(硬盘驱动器上有大约650 GB的可用空间)。 Yes, I tried re-installing (at least 4 times). 是的,我尝试重新安装(至少4次)。

EDIT 2: The page tied to my account was from the Microsoft website. 编辑2:与我的帐户相关联的页面来自Microsoft网站。 Step-by-step what I did was download the .iso, extract it to a folder with 7zip, run the autorun.exe file, go through with installation (Couldn't have been any errors there, all I did was check the "Privacy Policy" boxes and whatnot), opened up Visual Studio, typed in the code that I have below, and run it. 我的逐步操作是下载.iso,将其解压缩到包含7zip的文件夹中,运行autorun.exe文件,然后进行安装(那里没有任何错误,我所做的就是检查“隐私政策”框和其他内容),打开Visual Studio,输入下面的代码,然后运行它。 I didn't think that needed any explanation. 我认为这不需要任何解释。

我相信您应该尝试重新安装或仅在Visual Studio中执行修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM