I started using CUDA some weeks ago and I don’t have any problems when I use only the nvcc compiler but now I need to use nvcc and g++.
If I simplify my programs, I have 2 files : cppSource.cpp and cuSource.cu.
According to the g++ man. I had to compile cuSource.cu first and then cppSource,cpp. Thus, I’ve done the following :
But doing that, g++ considered “printHello” as undeclared and if I include “cuSource.cu” in cppSource.cpp. it looks for cuda.h and can’t go further.
If somebody understand what I’m doing wrong, that will help me a lot !