VSCode cannot open "sys/time.h" requested by UE4Proj on Windows platform

message: ‘cannot open source file “sys/time.h” (dependency of “MyUnrealProjName.h”)’

Why would it even happen? “sys/time.h” is Unix header and doesn’t exist on Windows.
I can compile my project fine in Visual Studio or inside UE Editor, but VSCode IDE complains.

I still try to figure out how to setup VSCode properly for UE4 so i might have miss something in c_cpp_properties.json, even though i have copied Visual Studio’s paths into includePath list of VSCode.

you were able to solve the problem?

i did solve the problem, although i am not sure what specifically did the magic and it were long ago.

i still operate and use my VSCode though so if you want i can copy you my c_cpp_properties.json so you and other guys could use it. (project name adjustments and path need to be made though to fit your machine)

This is caused by #include <Python.h> in ThirdParty libraries. Unreal Engine source code has a thirdparty Python3, in which there are Engine\Source\ThirdParty\Python3\Linux\include\Python.h and Engine\Source\ThirdParty\Python3\Win64\include\Python.h. VSCode intellisense will search for Python.h in lexicographical order, so Python.h under Linux directory is used, which further includes sys/time.h.