Mail Archives: djgpp/1997/09/22/09:30:29
Gordon German wrote:
> PS. I have since tried a small test program which calls the
> implimentation file:
>
> #include "matrix.cc"
>
> and matrix.cc includes matrix.h. This actually works, no errors. This
> trick doesn't seem to work for multi-file projects, however. You either
> get a "multiple define" error (if you include matrix.cc with each file
If your matric.cc file constains function's body, when you use it in
multi-file projects, their body is defined each time.
To solve your problem create an object matrix.o in compiling matrix.cc
and include only matrix.h in your other .cc files.
- Raw text -