"newly" installed visual studio returns 408 errors on blank program of type 'cannot open source file "errno.h" '

Pal*_*h35 2 c++ visual-studio visual-c++

Having installed VS 2019 on my PC, and opening up a new project, i get 408 errors that all say it cannot open various source .h files, such as errno.h, float.h, corecrt.h, etc. or 'the global scope has no "acosf" 'I had just installed visual studio and have no clue how it works, and have not done anything other than install it and open up a new project. Possibly useful information:

  • It was not installed in the default location, but on the D: drive
  • visual studio works fine when I open it with unity to edit scripts for my unity projects, but when opening it from its desktop icon or from the start menu, i get the errors
  • Unity was installed before i installed Visual studio and appears to be using a different version of visual studio somewhere else on my PC, but i cant find where it is, hence me installing it myself
  • The project is a C++ project

我已经尝试修复 Visual Studio 并重新安装它,但它不起作用。 Visual Studio 中的 408 错误

Ber*_*san 6

我遇到了同样的问题(此处),问题是由于某种原因,MSVS 没有将Windows Universal CRT SDK添加到包含和库路径(此 SDK 具有“float.h”等的头文件))。

要将其添加到您的项目中,您需要在项目设置中添加 include 和 lib 路径。

就我而言,他们是:

C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt <- header path
Run Code Online (Sandbox Code Playgroud)
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\ucrt\x64 <- library path
Run Code Online (Sandbox Code Playgroud)

(您可以通过搜索“float.h”和“ucrtd.lib”找到它,但请注意不要使用Linux头文件的路径)。

您可以在以下位置添加这些路径:(Project Properties -> C/C++ -> General -> Additional Include Directories 在此处添加标头路径)

然后Project Properties -> Linker -> General -> Additional Library directories (在此处添加库路径)