cuda cannot find standard C/C++ libraries?

Good Morning all, I am starting cuda programming with C/C++. I have experience with C/C++ but am a beginner in cuda. I have installed cuda library and can see the cuda template in Visual Studio 2017 professional.

I created a tutorial project with the integrated VS template and did not add anything myself yet, but somehow the standard C/C++ library (stdio.h and functions/macro fprintf, printf, stderr, kernel launch <<<) could not be found by the program and therefore project compilation failed. I do not think it is a problem of my VS installation (this is a new computer dedicated for cuda programming). I tried to create a very simple C program (with stdio.h and printf) and it can compile and run without any issue.

Any input is greatly appreciated!

Hailiang

Without any specific errors or exact software versions/screenshots, it’s going to be hard to troubleshoot what the issue might be. Maybe the CUDA template is not loading the correct include path for the standard headers… that is what it sounds like.

Ok, hope the attachment can be uploaded correctly. The previous post is my first one on the forum.

Thanks!

Unfortunately, the screenshot does not show why it failed. You will have to crank up the error verbosity to see why it’s failing:

Also, you are compiling in Debug mode. That will be slower and allow you to step through the code. Release mode compiles without adding any debug symbols and full optimizations. Just FYI.

For those of you who are experienced the same issue, I corrected it by installing Windows SDK using VS 2017 installer. For some reason my VS installation does not include Windows SDK. After the installation, my program can compile and run without issues.

Hailiang

1 Like

Can I have a screenshot to see which one you installed? Because I tried on my side but it still doesn’t work.

I have the same issue with the VS2017 project using Cuda.
Installing “Windows SDK version 8.1” and “Windows Universal CRT SDK” through the Visual Studio Installer has solved this problem.
I hope it helps!