[英]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:
这是你如何做到的:
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.