简体   繁体   中英

Visual studio cannot find the header files in Additional Include folders

I have been seeing this occasionally, but this project in particular is causing me to tear my hair out.

I have my .cpp .

#include <nppi.h>
#include <cuda.h>
#include <device_functions.h>
#include <cuda_runtime.h>

The Headers are in My project directory, in:

<Project file>\Thirdparty\CUDA\v8.0\include

my Additional includes are:

$(ProjectDir)Thirdparty\CUDA\v8.0\include

i have also tried:

Thirdparty\CUDA\v8.0\include

The includes are not found by intellisense, and i cannot open them with a right click. What am i doing wrong? or is this a bug?

Even with a hardcoded path in the Additional includes, the files are not found.

I am in Release mode. If i switch to Debug mode, some of the files are found, but some are not. The Additional includes seem to stay the same when I switch, this seems odd. (I have not added additional includes for Debug).

Thank you for your help, this is driving me mad.

Create a new folder named "include" in your project directory. Right-click on the project and then on Properties. CUDA C/C++ -> Additional Include Directories. Type into the upper half $(ProjectDir)include. it should evaluate this path correctly. Check that! In your kernel.cu that includes your main-function, type in #include "include\\mycode.cu". That worked for me. Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM