cereal icon indicating copy to clipboard operation
cereal copied to clipboard

Multiple defined symbols for CEREAL_CLASS_VERSION after update to VS 15.8

Open cstamatopoulos opened this issue 6 years ago • 4 comments

After upgrading to VS v15.8 I am getting a linker error for 2 out of many classes that are serialized using cereal. Anyone has similar issues ? Commenting out the CEREAL_CLASS_VERSION(MyClass, 1); from the 2 header files solves the issue but that is not helpful of course.

The error is something like this.

error LNK2005: "public: static unsigned int const cereal::detail::Version<class MyClass,struct cereal::detail::`anonymous namespace'::version_binding_tag>::version" (?version@?$Version@MyClass@@Uversion_binding_tag@?A0x58adc01e@detail@cereal@@@detail@cereal@@2IB) already defined in same_file.obj

cstamatopoulos avatar Aug 14 '18 19:08 cstamatopoulos