Goal:
test
executable for the shared l
The other answers did not work for me (maybe because I’m using cuda 10). The solution that worked for me was compiling the cuda files as:
nvcc -dc -o cuda_file.o cuda_file.cu
Than compiling the c++ file as:
g++ -c -o cpp_file.o cpp_file.cpp
And finally linking all using nvcc:
nvcc -o my_prog cpp_file.o cuda_file.o -lcudart -lcuda -L
Don’t take this code literally. But the core of the solution to the error was using nvcc instead of g++ in the final linking step.