Visual Studio 2017 ошибки на стандартных заголовках

33

Я только что обновился до Visual Studio 2017 Community Edition, и у меня возникли проблемы с загрузкой стандартных файлов заголовков. Я получаю 507 ошибок из разных файлов заголовков. Вот несколько фрагментов:

Некоторые из ошибок:

Severity    Code    Description Project File    Line    Suppression State
Error (active)  E1696   cannot open source file "errno.h"   RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cerrno  7   
Error (active)  E1696   cannot open source file "float.h"   RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cfloat  7   
Error (active)  E0282   the global scope has no "acosf" RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cmath   629 
Error (active)  E0282   the global scope has no "asinf" RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cmath   629 
Error (active)  E0282   the global scope has no "atanf" RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cmath   630 
Error (active)  E0282   the global scope has no "atan2f"    RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cmath   630 
Error (active)  E0282   the global scope has no "ceilf" RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cmath   630 
Error (active)  E0282   the global scope has no "cosf"  RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cmath   631 
Error (active)  E0282   the global scope has no "coshf" RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cmath   631 
Error (active)  E0282   the global scope has no "swprintf"  RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  21  
Error (active)  E0282   the global scope has no "swscanf"   RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  21  
Error (active)  E0282   the global scope has no "ungetwc"   RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  21  
Error (active)  E0282   the global scope has no "vfwprintf" RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  22  
Error (active)  E0282   the global scope has no "vswprintf" RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  22  
Error (active)  E0282   the global scope has no "vwprintf"  RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  22  
Error (active)  E0282   the global scope has no "wcrtomb"   RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  23  
Error (active)  E0282   the global scope has no "wprintf"   RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  23  
Error (active)  E0282   the global scope has no "wscanf"    RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  23  
Error (active)  E0282   the global scope has no "wcsrtombs" RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  24  
Error (active)  E0282   the global scope has no "wcstol"    RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  24  
Error (active)  E0282   the global scope has no "wcscat"    RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  24  
Error (active)  E0282   the global scope has no "wcschr"    RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  25  
Error (active)  E0282   the global scope has no "wcscmp"    RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  25  
Error (active)  E0282   the global scope has no "wcscoll"   RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  25  
Error (active)  E0282   the global scope has no "wcscpy"    RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  26  
Error (active)  E0282   the global scope has no "wcscspn"   RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  26  
Error (active)  E0282   the global scope has no "wcslen"    RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  26  
Error (active)  E0282   the global scope has no "wcsncat"   RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  27  
Error (active)  E0282   the global scope has no "wcsncmp"   RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  27  
Error (active)  E0282   the global scope has no "wcsncpy"   RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  27  
Error (active)  E0282   the global scope has no "wcspbrk"   RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\cwchar  28  
Error (active)  E0282   the global scope has no "wcsrchr"   RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools
Error (active)  E0260   explicit type is missing ('int' assumed)    RPGWorld    c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\xtgmath.h   212 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\Graphics\Glsl.inl    40  
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\Graphics\Texture.hpp 159 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\Graphics\VertexArray.hpp 64  
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\Graphics\VertexArray.hpp 72  
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\Graphics\VertexArray.hpp 88  
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\Graphics\VertexArray.hpp 104 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\Graphics\VertexArray.hpp 129 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\System\String.hpp    58  
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\System\String.hpp    332 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\System\String.hpp    345 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\System\String.hpp    365 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\System\String.hpp    387 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\System\String.hpp    387 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\System\String.hpp    399 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\System\String.hpp    413 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\System\String.hpp    413 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\System\String.hpp    427 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\System\String.hpp    427 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\System\String.hpp    456 
Error (active)  E0757   variable "size_t" is not a type name    RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\packages\sfml-system.2.4.0.0\build\native\include\SFML\System\String.hpp    456 
Error (active)  E0020   identifier "rand" is undefined  RPGWorld    c:\Users\Fazil\Documents\Visual Studio 2017\Projects\Local\RPGWorld\RPGWorld\Blocks.cpp 23  
Error   C1083   Cannot open include file: 'corecrt.h': No such file or directory    RPGWorld    c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.25017\include\crtdefs.h   10  
Error   C1083   Cannot open include file: 'corecrt.h': No such file or directory    RPGWorld    c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.25017\include\crtdefs.h   10  
Error   C1083   Cannot open include file: 'corecrt.h': No such file or directory    RPGWorld    c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.25017\include\crtdefs.h   10  
Error   C1083   Cannot open include file: 'corecrt.h': No such file or directory    RPGWorld    c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.25017\include\crtdefs.h   10  
Error   C1083   Cannot open include file: 'corecrt.h': No such file or directory    RPGWorld    c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.25017\include\crtdefs.h   10  
Error   C1083   Cannot open include file: 'corecrt.h': No such file or directory    RPGWorld    c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.25017\include\crtdefs.h   10  
Error   C1083   Cannot open include file: 'corecrt.h': No such file or directory    RPGWorld    c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.25017\include\crtdefs.h   10  
Error   C1083   Cannot open include file: 'corecrt.h': No such file or directory    RPGWorld    c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.25017\include\crtdefs.h   10  

У меня никогда не было этой проблемы с Visual Studio 2015 Community Edition. Я пропустил какой-то компонент из установщика? Любая помощь будет оценена по достоинству. Спасибо!

Теги:
visual-studio
visual-studio-2017

5 ответов

53
Лучший ответ

Я получил ошибки, чтобы уйти, установив компонент Windows Universal CRT SDK, который добавляет поддержку устаревших Windows SDK. Вы можете установить это с помощью установщика Visual Studio:

Изображение 117335

Если проблема все еще сохраняется, вам нужно изменить Target SDK в проекте Visual Studio: проверьте, является ли версия Windows SDK 10.0.15063.0.

В: Проект → Свойства → Общие → Версия Windows SDK → выберите 10.0.15063.0.

Затем будет найден файл errno.h и другие стандартные файлы, и он скомпилируется.

  • 9
    Я имею в виду, почему бы половину стандартной библиотеки не сломать в Win10SDK? Спасибо, что выяснили это!
  • 3
    Я хотел бы сказать, что эта ссылка также поможет мне решить проблему. stackoverflow.com/questions/43410631/...
Показать ещё 2 комментария
23

Если проблема не решена вышеуказанным ответом, проверьте, является ли версия Windows SDK 10.0.15063.0.

Проект → Свойства → Общие → Версия Windows SDK → выберите 10.0.15063.0

После этого перестройте решение.

  • 1
    По какой-то причине это было необходимо. В моем случае был выбран SDK 8.1. При переходе на 10.0.15063.0 это сработало.
7

Я обновил VS2017 с версии 15.2 до 15.8. С версией 15.8 вот что получилось:

Проект → Свойства → Общие → Версия Windows SDK → выбрать 10.0.15063.0 для меня больше не работает! Я должен был изменить его на 10.0.17134.0, а затем все построено снова. После обновления и без внесения этого изменения я получаю те же ошибки файла заголовка.

Я бы представил это как комментарий к одному из других ответов, но у меня пока недостаточно репутации.

  • 0
    Не сработало 10.0.17134.0 но у меня сработало 10.0.17763.0
0

Если кто-то все еще застрял на этом, самым простым решением, которое я нашел, было "Retarget Solution". В моем случае проект был построен из SDK 8.1, обновление до VS2017 принесло с собой SDK 10.0.xxx.

Чтобы перенастроить решение: Project-> Ретаргет Solution-> "Выбрать какой SDK вы установили" → ОК

Оттуда вы можете просто построить/отладить свое решение. Надеюсь, поможет

Изображение 117336

0

У меня была та же проблема. В моем случае причиной было то, что проекты были созданы на другой машине, используя другой выпуск Visual Studio 2017.

Ещё вопросы

Сообщество Overcoder
Наверх
Меню