build error after NVCC -cuda

Hi all,

Here is my platform: WINDOWS XP 32-bit (SP3)/CUDA 2.0/VS 8.0 sp1/8600m GS.

And here is my NVCC -cuda cmd format:

D:\CUDA\bin\nvcc.exe D:/Jesper/Med/workspace/Slicer3/Modules/VolumeRenderingCuda/CUDA_renderAlgo.cu -DNVCC --keep -cuda -o D:/Jesper/Med/workspace/Slicer3-build/src/cuda/CUDA_renderAlgo.cu_generated.c -I D:/CUDA/include...

After the above cmd finished successfully and c file generated, I got the following error when trying to build it into DLL by TP:

2>Compiling…

2>cl: Command line warning D9025 : overriding ‘/TP’ with ‘/TC’

2>CUDA_renderSingleSlice.cu_generated.c

2>d:\cuda\include\host_config.h(89) : error C2061: syntax error : identifier ‘type_info’

2>d:\cuda\include\host_config.h(89) : error C2059: syntax error : ‘;’

2>D:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin/…\INCLUDE\vadefs.h(50) : error C2059: syntax error : ‘string’

…(more than 100 here)

It seems to be something related to configuration. Here is the first several lines in the c file which may cause the error:

#line 1 "CUDA_renderAlgo.cudafe1.cpp"

#line 1 "D:/Jesper/Med/workspace/Slicer3/Modules/VolumeRenderingCuda/CUDA_renderAlgo.cu"

#line 89 "d:\cuda\include\host_config.h"

class type_info;

Could anyone help on this? Thanks in advance.

The default of “-cuda” output is “C++” file in CUDA2.0.
When the extension is changed from “. c” into “. cpp”, it will be able to
compile.

Thanks a lot. I found that I made a mistake so that I set the additional option of compilation as “/TC” instead of “/TP”.

It works after I changed it back.

I got almost the same problem.

I have a program in C code and I want to to added a CUDA function into it.

The main project in c extension. To include the CUDA I have added cu file to the project. The cu file contains the a function that invoke a device kernal from other cu extension. I got the following error:
error C2059: syntax error: ‘string’

My question is How can I integrate cu extension, contains the CUDA code, into a main program code has c extension.

Thanks
Hus