简体   繁体   English

使用Visual Studio C ++时发生400多个错误

[英]Over 400 errors when using Visual Studio C++

I am working on some coursework and the code works perfectly fine on the university system but when I transfer the exact same code to my own PC, I get over 400 error messages. 我正在做一些课程作业,并且代码在大学系统上可以正常工作,但是当我将完全相同的代码传输到自己的PC上时,我收到了400多条错误消息。 These consist of: 这些包括:

  • Cannot open source file "name.h" 无法打开源文件“ name.h”
  • The global scope has no "name" 全局范围没有“名称”
  • identifier "name" is undefined 标识符“名称”未定义
  • explicit type is missing ('int' assumed) 缺少显式类型(假定为'int')
  • A full list is here https://pastebin.com/CRJd7hAp 完整列表在这里https://pastebin.com/CRJd7hAp

I get these errors on all of my code, even something as simple as a Hello World program 我的所有代码都遇到了这些错误,甚至像Hello World程序一样简单

#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!  " << endl;
system("pause");
return 0;
}

I am at a loss as for what to do. 我不知所措。

I reinstalled Visual Studio and set the SDK from 8.1 to the newest release. 我重新安装了Visual Studio,并将SDK从8.1设置为最新版本。 Everything is working fine now. 现在一切正常。 Thank you 谢谢

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

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