Make sure that CUDA specific code, e.g. global functions and kernel calls like colordepthmap<<< blocksPerGrid, threadsPerBlock>>>(…) are in .cu files and are compiled using nvcc, not a regular C compiler.
This is covered in the copious documentation that comes with CUDA. If that seems overwhelming, you may want to try an introductory text on CUDA, e.g. the book “CUDA by Example”.
In the simplest form, you can compile a CUDA source file with nvcc like this: