Cannot open include file: 'cutil.h'

Hi all,
I have a C source file in which I’m using CUBLAS functions (its name is main.c) , when I am trying to call a CUDA kernel from this file, it cannot be compiled and I get this error message: Cannot open include file: ‘cutil.h’: No such file or directory

All CUDA kernels are in a separate file called my_kernel.cu, If the setting for this file in the Configuration properties/Tool must be CUDA or Custom Build Tool??

I have copied crutil.h in the directory of these files, but nothing changed!

I am using windows XP and VS 2005.

Any suggestion or help??!

Thanks guys

It’s in C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\common\include.

I know that, but the problem is that when I am compiling the C code it cannot find the cutil.h, and gives the error message.

I don’t have this error message when I am compiling a pure CUDA solution file.

Any suggestion??!

Add that path to the include directories in your project settings.

Actually I did it too, but nothing changed. Let me explain what I did from the beginning:

1-I made a C project (NOT a CUDA)

2-I used CUBLAS functions in the C source

Everything is ok up to here, and my program was working, but…

3-I made a cuda file and put my kernels in that. “cutil.h” is one of the headers in this file.

Now, when I compile the C project main file, it says: Cannot open include file: ‘cutil.h’: No such file or directory

I added cutil.h in the project folder and I add the address in the project properties, but it didn’t work!

If we have to make a CUDA project file to use the combination of CUDA and CUBLAS?

Thanks for your attention.

After setting the path it can find the cutil.h but during the Build Solution it gives 102 error which all of them are for the cutil.h, it seems that cutil.h is compiling with C compiler not with the cuda compiler, for your reference I have copied 2 of these errors below:

(I’m using windows XP64 )

1>C:\Program Files (x86)\NVIDIA Corporation\NVIDIA CUDA SDK\common\inc\cutil.h(122) : error C2143: syntax error : missing ‘{’ before ‘__cdecl’

1>C:\Program Files (x86)\NVIDIA Corporation\NVIDIA CUDA SDK\common\inc\cutil.h(124) : error C2146: syntax error : missing ‘)’ before identifier ‘verbose’

Any suggestion???

Thank you,

Maybe the problem comes from the fact that you’re including cutil.h from a .c file and not from a .cpp file. Demos in the SDK seem to all use .cpp.

In my experience it is impossible to use cutil.h from c-gcc. You will have to compile as cpp-source. Plain cuda is no problem, so.

“$(NVSDKCUDA_ROOT)\common\inc”;“$(CUDA_INC_PATH)”

Hello. I was wondering if this problem was resolve. We are having the same problem with the CUDA kit 3.2 November release. The installation is missing common directory. I filled in the file from another installation, but now ‘cutil32D.lib’ is missing. Is this an installer error ?