The structure of my code is:
main.cpp
–cudacode.cu
–cudacode.h
–func1.cpp (with opencv)
–func1.h
And I compile like this:
g++ -c func1.cpp $(pkg-config --cflags --libs opencv)
nvcc -lcuda -cublas cudacode.cu -c -arch…
This compiled normally. but,
when i compiled main.cpp
g++ -o main -l/usr/local/cuda/lib64 -lcuda -lcudart main.cpp func1.o cudacode.o
error has occurred.
→ fatal error: cuda.h: No such file or directory
I have tried the following(google search):
<cuda.h> → “cuda.h”
cuda.h → cuda/cuda.h
However, it was not resolved.
Is this a “-l/usr/local/cuda/lib64” problem?
Or is there another problem?