I have this project with the following file structure :
|-- CG.cu |-- Makefile |-- examples | |-- ex2.h | |-- ex3.h | |-- mmio.c | |-- mmio.h | |-- nos4.mtx |-- util.h
CG.cu is my main program (A Conjugate Gradient solver) i have some help functions in util.h and then i have some hardcoded examples in ex2.h and ex3.h (I know it's bad practice, but it's okay for now) the problem is that ex3.h need mmio.c,mmio.h and nos4.mtx to load in the example.
So basically the flow is : CG.cu -> ex3.h -> mmio.h (mmio.c) The compiler (NVCC : later being ported for cuda) complains about undefined references for the mmio functions.
Currently my Makefile looks like this:
main: CG.cu util.h
NVCC -o main CG.cu
and GC.cu uses #include "examples/ex3.h"
, and ex3.h uses #include "mmio.h"
Can you help me?