Ask for help! Troubled by error MSB4018 in visual studio 2010 when build a cuda project.

My project enviroment : 64bit machine + windows 7 64bit + visual studio 2010 + cuda 5.5 64bit

I try to open a sample project in the cuda5.5 SDK.

And I choose project->build project

But At last it reports such error information: It said the error is error MSB4018. Could someone help me to solve this problem.~ Wait for U

C:\Users\dell\documents\visual studio 2010\Projects\gldering1\gldering1>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\bin\nvcc.exe” -ccbin “E:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin” -I"C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\common\inc" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -g -DWIN32 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MTd " -o Debug\fft.cu.obj “C:\Users\dell\documents\visual studio 2010\Projects\gldering1\gldering1\fft.cu” -clean
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets(758,9): error MSB4018: “CudaCompile”task fails unexpected。
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets(758,9): error MSB4018: System.UnauthorizedAccessException: access to“C:\Users\dell\AppData\Local\Temp\cfc8d23858db44c286adb9d595a4be94.cmd”is denied。
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets(758,9): error MSB4018: in System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets(758,9): error MSB4018: in System.IO.File.Delete(String path)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets(758,9): error MSB4018: in Microsoft.Build.Utilities.ToolTask.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets(758,9): error MSB4018: in Microsoft.Build.Tasks.Xaml.XamlDataDrivenToolTask.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets(758,9): error MSB4018: in Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets(758,9): error MSB4018: in Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)
========== Succeed 0 ,Fail 1 ,Skip 0 ==========

It seems you have an unauthorized directory access to “C:\Users\dell\AppData\Local\Temp\cfc8d23858db44c286adb9d595a4be94.cmd”. Do you have enough privileges to access that directory?

Yes ,I run this project in vs2010 as Administrator. I have checked that I have full control privilege of this file.

We have the same issue. Sometime the same machine, the same account will work, but sometimes will not. Does any one know why?

Maybe some help here:

“… eventually tracked it down to a spurious trailing slash on OutputFile. Remove it and the error goes away.”

I guess he means the [OutputFile] setting in [Properties] [Linker] [General] ?

E.g., I have: (OutDir)(TargetName)$(TargetExt)

which expands to “D:\My\Path” + “AppName” + “.exe”

Sorry but that doesn’t help. We don’t have trailing slash in our paths.