Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cuda 5.0 linking with samples .h in Visual Studio 2010

I have visual studio 2010 ultimate and cuda toolkit 5.0. the samples work perfectly. VS recognize cuda`s language, syntax and works fine. but when I tried something like this:

#include <helper_functions.h>

 #include <stdio.h>

 #include <stdio.h>


  int main()
  {
  return 0;
  }

the compiler can't find helper_functions.h (this header file come with the samples and is in C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.0\common\inc and my program and the samples aren`t in the same directory.)

when I try with the absolute path:

  #include <C:\ProgramData\NVIDIACorporation\CUDASamples\v5.0\common\inc\helper_functions.h>
  #include <stdio.h>


 int main()
 {
 return 0;
 }

compiler : exception.h no such file or directory

helper_functions.h and exception.h are in the same directory.

I know that I have to link them but I don`t know how do that with VS

like image 483
user1848435 Avatar asked Dec 03 '25 23:12

user1848435


1 Answers

You are using visual studio 2010 so you should add the path to your project. Just right click on the name of the project, select properties. under configuration properties select VC++ Directories. add an extra ; at the end of Include Directories and add C:\ProgramData\NVIDIACorporation\CUDASamples\v5.0\common\inc\. also the common directory might also have a lib folder that you should add under Library Directories.

You should do this for each project that needs them. also you can copy them to your VS directory under VC\include.

like image 165
Soroosh Bateni Avatar answered Dec 07 '25 00:12

Soroosh Bateni