jjzjj

msTypeId

全部标签

c++ - CMake 生成的 DLL 和 Curiously Recurring 模板 (C++) 的不正确行为

我在Windows上遇到了CMake生成的DLL文件的令人困惑的问题。在我的库中,我使用CuriouslyRecurringTemplatePattern为某些类提供唯一的ID号://da/Attribute.h:#ifndefDA_ATTRIBUTE_H#defineDA_ATTRIBUTE_Hnamespaceda{typedefunsignedintAttributeId;classAttributeBase{public:virtualAttributeIdgetTypeId()const=0;protected:/**StaticIDcounter.Everyclasstha