致命错误C1083:无法打开包含文件:'iostream':没有这样的文件或目录 [英] fatal error C1083: Cannot open include file: 'iostream': No such file or directory
问题描述
我已多次重新安装Visual Studio 2010 Professional以尝试使其工作。
我不得不卸载Visual Studio 2012 Professional,因为它没有编译我们在课堂上做的事情。
I've reinstalled Visual Studio 2010 Professional several times to try to get it to work. I had to uninstall Visual Studio 2012 Professional because it wasn't compiling something we did in class.
我完全卸载了包括SQL Server在内的所有内容..
I completely uninstalled everything including SQL Server..
我去了VC / include和iostream头文件不存在。
I went to VC/include and the iostream header file is not there.
#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!!!
每次我这样做; new project => empty project =>将一个项目添加到source =>。cpp
Every time I do; new project => empty project => add an item to source =>.cpp
我正在运行Windows 8.
I'm running windows 8.
它只是说Error无法打开源文件
另外,错误cout标识符未定义....
It just says Error cannot open source file Also, error cout identifier is undefined....
我想知道我是否应该这样做系统还原?
或者我是否应该从恢复媒体中完全重新安装Windows 8?
I'm wondering if I should do a system restore? Or if I should just completely reinstall windows 8 from my recovery media?
推荐答案
一个问题是你没有包含命名空间 std
。
One problem is that you did not include the namespace std
.
这是你的代码应该是这样的:
This is what your code should look like:
#include <iostream>
using namespace std;
int main (void) {
cout << "hello" << endl;
system("pause");
return 0;
}
或者你可以这样做: std :: cout<< 你好<< std :: endl;
这可能是一个问题,因为您没有将环境设置为C ++。您就是这样做的:
This may be a problem because you did not set your environment to C++. This is how you do it:
- 转到工具> 导入和导出设置。如果找不到,只需在快速搜索中搜索
- 然后转到重置所有设置。
- 然后只需选择Visual C ++
- 重启。
- Go to Tools > Import and Export settings. If you cannot find it, just search for it in Quick Search
- Then go to reset all settings.
- Then simply select "Visual C++"
- Restart.
这应该可以解决问题。如果没有,您可以考虑重新安装Visual C ++本身。对于 VS 2012 。如果这不起作用,请重新安装程序。
That should do the trick. If it does not, you might consider re-installing Visual C++ itself. For VS 2012. If that does not work, then re-install the program.
这篇关于致命错误C1083:无法打开包含文件:'iostream':没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!