Maybe it's a bug about the -L&-l command

When I use command line to compiler the cu file. Add the -L or -l command, if there is a space in the command, it can’t work!

Just see here:
http://forums.nvidia.com/index.php?showtopic=66578

If the command like this:
nvcc.exe -ccbin “C:\Program Files\Microsoft Visual Studio 8\VC\bin” -deviceemu -link -D_DEBUG -DWIN32 -D_CONSOLE -D_MBCS -Xcompiler /EHsc,/W3,/nologo,/Wp64,/Od,/Zi,/RTC1,/MTd -IC:\CUDA\include -I./ -I"C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\common\inc" -l"C:\CUDA\lib\cudart" -l"C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\common\lib\cutil32" simpleTexture.cu

The -l command find the path of c:\program.obj - -! but not cutil32.lib - -!

Spaces should work, but I find the -l options with absolute paths as arguments quite suspicious: -l is intended to search in paths specified with -L.

I would like to see this command reformulated as either

nvcc.exe -ccbin “C:\Program Files\Microsoft Visual Studio 8\VC\bin”
-deviceemu -link -D_DEBUG -DWIN32 -D_CONSOLE -D_MBCS -Xcompiler
/EHsc,/W3,/nologo,/Wp64,/Od,/Zi,/RTC1,/MTd -IC:\CUDA\include -I./
-I"C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\common\inc"
-L"C:\CUDA\lib" -lcudart -L"C:\Program Files\NVIDIA Corporation\NVIDIA
CUDA SDK\common\lib" -lcutil32" simpleTexture.cu

or

nvcc.exe -ccbin “C:\Program Files\Microsoft Visual Studio 8\VC\bin”
-deviceemu -link -D_DEBUG -DWIN32 -D_CONSOLE -D_MBCS -Xcompiler
/EHsc,/W3,/nologo,/Wp64,/Od,/Zi,/RTC1,/MTd -IC:\CUDA\include -I./
-I"C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\common\inc"
“C:\CUDA\lib/cudart.lib” “C:\Program Files\NVIDIA Corporation\NVIDIA
CUDA SDK\common\lib/cutil32.lib” simpleTexture.cu

and if the problem persists I would like to see a -v trace of this command (add -v as nvcc option).

Thanks your comments. And them can get the a.exe.

And I also try my command add -v and get the errors.

Here is the put out of the command:

#$ cl -D__CUDA_ARCH__=100 -nologo -Fe"a.exe" “C:\DOCUME~1\kelvin\LOCALS~1\Temp/t
mpxft_00001a4c_00000000-8_simpleTexture.obj” -link -INCREMENTAL:NO C:/CUDA/lib/c
udart.lib C:/Program Files/NVIDIA Corporation/NVIDIA CUDA SDK/common/lib/cutil32
.lib “/LIBPATH:C:\CUDA\bin/…/lib” cudart.lib
LINK : fatal error LNK1181: cannot open input file ‘C:/Program.obj’

We can see, the “C:/Program Files/NVIDIA Corporation/NVIDIA CUDA SDK/common/lib/cutil32.lib” was cut down by the space.

The whole messages are in the nvcc_v_l_command.txt.
nvcc_v_l_command.txt (11.1 KB)