Problem building SDK examples in Visual c++ 2008

Hi all,

I get the following error when trying to build the SDK examples that come with Cuda 2.1:

1>Performing Custom Build Step
1>The system cannot find the path specified.
1>Project : error PRJ0019: A tool returned an error code from “Performing Custom Build Step”

From the log file, the command issued is

“C:\Program Files\CUDA\bin\nvcc.exe” -ccbin “c:\Program Files\Microsoft Visual Studio 9.0\VC\bin” -c -D_DEBUG -DWIN32 -D_CONSOLE -D_MBCS -Xcompiler /EHsc,/W3,/nologo,/Wp64,/Od,/Zi,/RTC1,/MTd -I"C:\Program Files\CUDA\include" -I./ -I…/…/common/inc -o Debug\volumeRender.obj volumeRender.cu

I know there was an issue with earlier versions that quotation marks were not placed correctly, but as you can see here it is ok in this version.

My specs are:

GeForce 8400M GS
Cuda 2.1
Microsoft Visual C++ 2008
Vista 32-bit

Thanks in advance!

Do you have the CUDA installation path set correctly? (I think it should be C:\CUDA, not C:\Program Files\CUDA)

Yes, I have it set correctly in my environment variables.

CUDA_BIN_PATH C:\CUDA\bin

How can I find out which path the compiler is having trouble finding? The log says nothing about it.

EDIT: Oh yes, even though in my environment variables I had it set right, but the command line set in properties in VC was still using C:\Program Files\CUDA.

Ok I fixed that now, thanks!

But I really don’t understand, doesn’t VC read these variables from the environment variables, where I have C:\CUDA… ?

Where must I configure in the nvcc compiler in Visual Studio 2009

Go to the file properties of your .cu file, and define a custom build tool.

You can see this post on setting cuda configuration properties.