vcruntime.h missing from Windows include folder?
Asked Answered
C

4

6

I'm a beginner and I'm trying to build an open source project for the first time in Windows, but I keep running into file not found errors when building. What I've found so far is that a header file called corecrt.h is located at C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\. This file would include another header file named vcruntime.h. The problem is that vcruntime.h is nowhere to be found in that folder.

I later found that vcruntime.h is located in a separate folder located at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include. This is strange because I'm not sure why corecrt.h would include a file that is not in its own filepath...

I did the bone-headed thing of just copying over vcruntime.h file to the C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\, but this just shifts the problem down the road because vcruntime.h in turn also includes other header files located at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include, and so on.

I think the issue lies with Windows itself. I think I'm missing something that's suppose to install additional header files like vcruntime.h to C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\

So far I've tried uninstalling/reinstalling Windows SDK, and just reinstall Windows as a whole, but still no dice to make the missing files appear in that folder. Can someone give me some insight on this? I've asked this question on Reddit but so far nothing has been able to help.

Here's the link to the instructions I'm following on how to build https://wiki.documentfoundation.org/Development/BuildingOnWindows

I'm building using their suggested environment Lode on my Windows 10 machine.

I get C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt.h(10): error: vcruntime.h: No such file or directory

The error occurs right at the build step and I run make 2>&1 | tee build.log

Cape answered 28/6, 2020 at 0:11 Comment(6)
The directories where you found those headers look right, but if the compiler doesn't find them it means the "include" path is not set correctly. This is a matter of project or makefile or perhaps command line you are using, but it's hard to tell without more details about what you are attempting to build and how exactly.Furnishings
It's for LibreOffice. Here's the link to the instructions wiki.documentfoundation.org/Development/BuildingOnWindowsCape
That page describes several ways to build different parts in different configurations. Please edit your question and specify what your setup is, what you are trying to build and the exact error message(s) at which step.Furnishings
yes, this files in different locations corecrt.h - inside ucrt in sdk, vcruntime in vc crt. nothing need copy or reinstall. but ser correct paths in vs or per projectPennate
@Furnishings Done. I updated the OPCape
Try running the build from a Visual Studio command prompt (not your regular command prompt), unless you're doing that already.Littlejohn
F
0

I too had the same issue, but found the cause which was the Include directories were not specified correctly. To fix this I did the following with Visual Studio:

  1. Right click on the project name, and then click on Properties.
  2. Under Configuration Properties, select VC++ Directories.
  3. The Include directories should contain $(VC_IncludePath);$(WindowsSDK_IncludePath); - correct this.
  4. Click OK to save and Bob's your uncle.
Fifield answered 11/6, 2021 at 17:20 Comment(2)
This did not work for me.Picked
This did not work for me either on vs2022Grenade
M
0

You most likely use cygwin for make. The source of the issue is that linux is getting a nightmare when you have spaces in path names, so they are being converted to Windows 8.3 format, like C:/PROGRA~2/.

In your particular case, after autogen.sh created config_host.mk file, check SOLARINC variable in it. It should only contain Windows 8.3 path names, like -IC:/PROGRA~2/, no cygdrive.

Malamute answered 11/9, 2023 at 10:52 Comment(0)
S
0

I cured this some how. Use /I"search path" with [full path]:>cl.exe.
E.g.:

C:\msvc\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\cl.exe /I"C:\msvc\VC\Tools\MSVC\14.40.33807\include" /I"C:\msvc\Windows Kits\10\Include\10.0.26100.0\ucrt" [path  to source file]/main.c
Sopher answered 13/8, 2024 at 5:55 Comment(0)
T
-1

I too had the same issue in Visual Studio 2019 when compiling a legacy project from an older version of Visual Studio. Solved the following way:

  1. Right click on the project name, and then click on Properties.
  2. Under Configuration Properties, select General.
  3. Switch Platform Toolset to the latest version.
Towery answered 4/11, 2023 at 2:26 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.