在Visual Studio中运行代码的数百个构建错误

时间:2018-12-04 18:40:37

标签: c++ visual-studio visual-studio-2017

在运行代码时出现此问题,并且在尝试运行代码时出现450个构建错误。

该程序是用于大学课程的,所以我主要是在房间里的计算机上进行工作的,但是我去uni提出了一些问题,从github上获取了我的代码,尝试运行,然后就得到了所有这些错误信息。我问老师,他说可能是因为Windows或VS版本不同,但是我要做的就是右键单击该项目,然后按“重新定位解决方案”。奏效了。

但是我回到家了,我做了重新定位解决方案,但是由于某种原因,它似乎什么也没做,我遇到了所有这些错误。Error list

如果可以帮助将错误记录在文本中,请复制以下几个错误。这些不是我项目中的类。我认为它们是c ++标准库或类。

Severity    Code    Description Project File    Line    Suppression State
Error (active)  E1696   cannot open source file "errno.h"   Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cerrno  7   
Error (active)  E1696   cannot open source file "float.h"   Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cfloat  7   
Error (active)  E1696   cannot open source file "corecrt.h" Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\crtdefs.h   10  
Error (active)  E1696   cannot open source file "stddef.h"  Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cstddef 7   
Error (active)  E1696   cannot open source file "stdio.h"   Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cstdio  8   
Error (active)  E1696   cannot open source file "stdlib.h"  Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cstdlib 8   
Error (active)  E1696   cannot open source file "math.h"    Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cstdlib 9   
Error (active)  E0282   the global scope has no "acosf" Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cmath   27  
Error (active)  E0282   the global scope has no "acoshf"    Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cmath   32  
Error (active)  E0282   the global scope has no "asinf" Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cmath   37  
Error (active)  E0282   the global scope has no "asinhf"    Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cmath   42  
Error (active)  E0282   the global scope has no "atanf" Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cmath   47  
Error (active)  E0282   the global scope has no "atanhf"    Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cmath   52  
Error (active)  E0282   the global scope has no "atan2f"    Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cmath   57  
Error (active)  E0282   the global scope has no "cbrtf" Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cmath   62  
Error (active)  E0282   the global scope has no "ceilf" Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cmath   67  
Error (active)  E0282   the global scope has no "copysignf" Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cmath   73  
Error (active)  E0282   the global scope has no "cosf"  Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cmath   78  
Error (active)  E0282   the global scope has no "coshf" Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cmath   83  
Error (active)  E0282   the global scope has no "erff"  Coursework  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include\cmath   88  

1 个答案:

答案 0 :(得分:0)

所以这实际上不是什么大问题。我要做的就是“重新定位解决方案”。关闭VS,然后从本地存储库重新打开解决方案。我在朋友的某些计算机上尝试过同样的事情,所以我必须做同样的事情。

无论哪种方式,问题都能“解决”。