Add another *.cu is useless

Hello ~ All

I copied the template.project to be my new CUDA project named “Main_func”…
It’s ok to compile and run the code…

Now, I want to add another *.cu file named " Sub_func.cu "…
“Sub_func.cu” is a sub_function. Because it also uses CUDA function, so it has to include the “cutil.h”.
After adding and compiling this, there’s a warning said ~
" Sub_func.cu Cannot open include file: ‘cutil.h’: No such file or directory "

“Main_func.cu” file also includs “cutil.h” and could be compiled successfully.
But…Why is “Sub_func.cu” compiled unsuccessfully? :wacko:

Do I need to set something in VC2005 ?

Thanks your suggestion!!

If you are adding new cu files directly to your project then you need set the build instructions. Go to Main_func.cu and open up its properties and look under Custom Build Step. You will have to set that up for Sub_func.cu.

[

" Sub_func.cu Cannot open include file: ‘cutil.h’: No such file or directory "

Do I need to set something in VC2005 ?

[/quote]

-Right click on sub_func.cu

-click on properties

-Click on CUDA [ + symbol ]

-go to General

  • Go to Additional directiries

-Here you have to give the path for the cutil.h

-click on ok

now compile, it should work.

Thanks~~your answer !! I’ve solved this problem … Thanks!! :">