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

别说谁变了你拦得住时间么 提交于 2019-12-05 17:03:49

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;
}

or you could have done something like this: std::cout << "Hello" << std::endl;

This may be a problem because you did not set your environment to 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++"
  4. Restart.

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.

if it is problem with visual studio 2012, install this update.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!