It seems that it's legal to have the same class declared across multiple translation units. I am using separate header files and cpp files for my class- for declaration and for definition. I use header guards of course , but don't header guards only prevent the same header file from being included in the same translation unit? My class header file is included in many translation units and there are no conflicts or problems.
Now, the problem that I encountered was trying to include a different header file across different translation units used for configuration data that contains structure and variable declarations. The linker complains that there are multiple definitions.
Why is ok to have multiple declarations of classes across different translation units but not structures or other variables? By the way, the structures in that header file are initialised with data. Is this my problem? but also my class has default values. Thanks in advance