I have a template matrix class class defined in the header called "Matrix.h".
My program uses several matrices repeatedly. I thought that I would define them in the header file "Matrix.h", for example:
const Matrix<GLfloat> B_SPLINE_TO_BEZIER_MATRIX(4, 4, values);
When I do this, g ++ complains that I have overridden this constant. This is because I include Matrix.h in two different source files. When the object files for them are compiled, both end with the definition of the above matrix, causing an error message.
My question is: how can I avoid this situation? I want a constant available for several files, but I donβt know where to put it.
source share