简体   繁体   English

致命错误C1083:无法打开包含文件:'iostream':没有这样的文件或目录

[英]fatal error C1083: Cannot open include file: 'iostream': No such file or directory

I've reinstalled Visual Studio 2010 Professional several times to try to get it to work. 我已经多次重新安装Visual Studio 2010 Professional以尝试使其工作。 I had to uninstall Visual Studio 2012 Professional because it wasn't compiling something we did in class. 我不得不卸载Visual Studio 2012 Professional,因为它没有编译我们在课堂上做的事情。

I completely uninstalled everything including SQL Server.. 我完全卸载了包括SQL Server在内的所有东西。

I went to VC/include and the iostream header file is not there. 我去了VC / include,iostream头文件不存在。

#include <iostream>

int main () {

cout << "hello";

system ("PAUSE");
return 0;
}

This is all I'm trying to do because nothing else is working. 这就是我正在努力做的事情,因为没有别的办法。

It's really driving me crazy because I need to get it working so that I can do my project!!! 它真的让我发疯,因为我需要让它工作,以便我可以做我的项目!

Every time I do; 我每次都这样做; new project => empty project => add an item to source =>.cpp new project => empty project =>将一个项添加到source => .cpp

I'm running windows 8. 我正在运行Windows 8。

It just says Error cannot open source file Also, error cout identifier is undefined.... 它只是说Error无法打开源文件另外,错误cout标识符是未定义的....

I'm wondering if I should do a system restore? 我想知道我是否应该进行系统还原? Or if I should just completely reinstall windows 8 from my recovery media? 或者,如果我应该从恢复媒体中完全重新安装Windows 8?

One problem is that you did not include the namespace std . 一个问题是你没有包含命名空间std

This is what your code should look like: 这是你的代码应该是这样的:

#include <iostream>
using namespace std;

int main (void) {
    cout << "hello" << endl;
    system("pause");
    return 0;
}

or you could have done something like this: std::cout << "Hello" << std::endl; 或者你可以这样做: std::cout << "Hello" << std::endl;

This may be a problem because you did not set your environment to C++. 这可能是一个问题,因为您没有将环境设置为C ++。 This is how you do it: 这是你如何做到的:

  1. Go to Tools > Import and Export settings . 转到工具 > 导入和导出设置 If you cannot find it, just search for it in Quick Search 如果找不到,只需在快速搜索中搜索即可
  2. Then go to reset all settings. 然后去重置所有设置。
  3. Then simply select "Visual C++" 然后只需选择“Visual C ++”
  4. Restart. 重新开始。

That should do the trick. 这应该够了吧。 If it does not, you might consider re-installing Visual C++ itself. 如果没有,您可以考虑重新安装Visual C ++本身。 For VS 2012 . 对于VS 2012 If that does not work, then re-install the program. 如果这不起作用,则重新安装程序。

如果Visual Studio 2012出现问题,请安装更新。

暂无
暂无

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

相关问题 SWIG致命错误C1083:无法打开包含文件 - SWIG Fatal error C1083: Cannot open include file QtCreator中的“致命错误C1083:无法打开包含文件” - “Fatal Error C1083: Cannot open include file” in QtCreator (特殊情况,可能与VC目录设置有关)致命错误C1083:无法打开包含文件:&#39;iostream.h&#39;:没有此类文件或目录 - (Special case, might related to VC directory setting) fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory C1083无法打开包含文件:“ iostream”,“ vector”等 - C1083 Cannot open include file: 'iostream', 'vector' and more 严重错误C1083:无法打开包含文件:&#39;xmemory&#39;:没有此类文件或目录 - fatal error C1083: Cannot open include file: 'xmemory': No such file or directory 严重错误C1083:无法打开包含文件:&#39;mexutils.h&#39;:没有此类文件或目录 - fatal error C1083 : Cannot open include file: 'mexutils.h': No such file or directory 致命错误 C1083:无法打开包含文件:&#39;opencv2/core.hpp&#39;:没有那个文件或目录 - Fatal error C1083: Cannot open include file: 'opencv2/core.hpp': No such file or directory 严重错误C1083:无法打开包含文件:&#39;vld.h&#39;:没有此类文件或目录 - fatal error C1083: Cannot open include file: 'vld.h': No such file or directory 致命错误 C1083:无法打开包含文件:“xyz.h”:没有这样的文件或目录? - fatal error C1083: Cannot open include file: 'xyz.h': No such file or directory? 致命错误C1083:无法打开包含文件:&#39;boost / variant.hpp&#39;:没有这样的文件或目录 - fatal error C1083: Cannot open include file: 'boost/variant.hpp': No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM