Error: redefinition of class XXX
error redefinition of class XXX
; meanwhile, error previous definition of class XXX
error:
generally, the error is caused by not using #ifndef
, #define
and #endif
for protection in the header file (.h) of the class definition. In other words, there is no macro to prevent the class from being included multiple times.
or the class is defined repeatedly, so take a closer look at your code to see if it is defined repeatedly.
modification:
adds a macro to a class that prevents it from being included multiple times:
#ifndef _BASESMOOTHINGALGORITHM_H_
#define _BASESMOOTHINGALGORITHM_H_
#include "BaseSmoothingAlgorithm.h"
#endif
div>