I am trying to Build a Solution on Visual Studio Community 2017, but I keep getting the error \"Cannot open include file: \'stdio.h\' \". I\'ve read through
Faced the same issue, another solution is to add default includes, this fixed the problem for me:
$(IncludePath);
I had a similar problem after updating my VS2017. Project built fine; but lots of 'errors' when code was brought up in the editor. Even tried reinstalling VS. I was able to solve it by setting the option “Ignore Standard Include Paths” to Yes. Attempted to build the solution with lots of errors. Went back and set the option to No. After rebuilding, my problem went away.
Faced the problem of missing stdlib.h
and stdio.h
(and maybe more) after installing VS2017 Community on a new computer and migrating a solution from VS2013 to VS2017.
Used @Maxim Akristiniy's proposal, but still got error message regarding toolset compatibility. However VS itself suggested to do solution retarget by right-clicking on the solution in Solution Explorer, then selecting Retarget solution
from the menu and the updated Windows SDK Version
from the drop-down list.
Now my projects build w/o a problem.
Note that you may need to make the project your startup project for the retargeting to catch.
Just in case you don't want to bump Windows SDK to Windows 10 (you could be for example working on an open source project where the decision isn't yours to make), you can solve this problem in a Windows SDK 8.1 project by navigating Tools -> Get Tools and Features... -> Individual Compontents tab
and installing the individual components "Windows 8.1 SDK" (under SDKs, libraries and frameworks) and "Windows Universal CRT SDK" (under Compilers, build tools and runtimes):
Similar problem for me but a little different. I can compile and run the default CUDA 10 code with no problem, but there are a lots of error related to the stdio.h file show in the edit window. Which is annoying. I solve it by change the code file name from "kernel.cu" to "kernel.cpp". That is wired but works for me. And it runs well so far.
For CUDA:
Right Click on your project.
Go to Properties->CUDA and set "CUDA Toolkit Custom Dir" to your CUDA toolkit directory.
For me it was: C:\\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0