Trouble compiling .cu file

I have setup a Visual Studio 2005 project with Qt. I have used the rulefile for *.cu files found on this forum and applied it to my project. When compiling the .cu file I get strange errors. The compiler cannot find uint datatype nor constants declared in math.h. I have added the appriopriate include dir’s and libraries to the project. The nvcc command line can be seen below.

nvcc.exe -ccbin "C:\Program Files\Microsoft Visual Studio 8\VC\bin"  -c  -Xcompiler "/EHsc /W3 /nologo /Wp64 /O2 /Zi   /MT "  -o Debug\cudasqrt3Kernel.obj cudasqrt3Kernel.cu

Has anyone had similar problems? Any suggestions are much appreciated.

Can’t find the include dirs & libs in ur command line. where did u put them in the project?

I put them in the project properties under C++ and Linker properties.

You should put the include dirs into the cu compiler but not C++ compiler.

If u added the rules, you can add the include dirs in the CUDA general category;

Or you can also add the dirs into the custom compiler rule;

Thanks a lot. So far I’ve removed most errors. Now the problem that persists is that atomicAdd function is not found. I have included the sm_11_atomic_functions.h and added the $(CUDA_INC_PATH). What am I missing to get this included?

SOLVED! (I had forgotten the -arch sm_11)

I’m not sure which lib contents the atomicAdd function……

You can check it in example, and find the lib name, then add it to the project^_^

:)

Thanks for your help. It’s much appreciated.