I used the custom build file I found on these forum.
So now I am able to compile .cu files.
However, I get the following compilation errors:
1>Compiling…
1>ReconstructCUDA.cu
1>“C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\xlocinfo”, line 77: error:
1> support for exception handling is disabled
1> throw runtime_error(“bad locale name”);
1> ^
1>“C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\xlocinfo”, line 87: error:
1> support for exception handling is disabled
1> throw runtime_error(“bad locale name”);
1> ^
And etc.
I have the enable C++ exceptions on Yes in my project, and I can’t find any other important difference from my project to the sample project in which the CUDA code I wrote compiles perfectly.
nvcc fatal : A single input file is required for a non-link phase when an output file is specified
If I do some variations with putting “” around (which I am not sure what they do) then I get the previous errors.
The /EHsc flag is the flag about exceptions, so this may be related to the errors I get with the exceptions.
You might be missing a ‘space’ in one of the parameters you pass to nvcc. I remember making that error and getting the ‘Only one input file’ error you have mentioned.
This problem was due to some changes I did in the command line, but when I have a good command line, with all the options and no extra spaces or ‘,’, then I get the excpetions errors which I don’t know how to deal with.
I have solved the problem, you might be interested in the solution because similar problems may happen with other file names.
The problem was simply that in my code library I had two files: Math.h and Math.cpp.
Apparantly cuda with visual was looking for a math.h, and accidently found my math.h file.
I assume that if cuda have other files, then creating files with the same names as the cuda files will cause the same problem.