Linker Error
-
I have a class derived from CMultiDocTemplate, where I have overloaded the OpenDocumentFile and InitialUpdateFrame functions. I am adding this class as a member to my App Class. When I try and compile this bare bones MFC app, the linker is complaining that :: emo_test error LNK2005: "public: __thiscall CWorkSpaceDocTemplate::CWorkSpaceDocTemplate(unsigned int,struct CRuntimeClass *,struct CRuntimeClass *,struct CRuntimeClass *)" (??0CWorkSpaceDocTemplate@@QAE@IPAUCRuntimeClass@@00@Z) already defined in ChildFrm.obj as well as the destructor and the other functions i have overloaded? What is causing this? Ryan Baillargeon
-
I have a class derived from CMultiDocTemplate, where I have overloaded the OpenDocumentFile and InitialUpdateFrame functions. I am adding this class as a member to my App Class. When I try and compile this bare bones MFC app, the linker is complaining that :: emo_test error LNK2005: "public: __thiscall CWorkSpaceDocTemplate::CWorkSpaceDocTemplate(unsigned int,struct CRuntimeClass *,struct CRuntimeClass *,struct CRuntimeClass *)" (??0CWorkSpaceDocTemplate@@QAE@IPAUCRuntimeClass@@00@Z) already defined in ChildFrm.obj as well as the destructor and the other functions i have overloaded? What is causing this? Ryan Baillargeon
-
I have a class derived from CMultiDocTemplate, where I have overloaded the OpenDocumentFile and InitialUpdateFrame functions. I am adding this class as a member to my App Class. When I try and compile this bare bones MFC app, the linker is complaining that :: emo_test error LNK2005: "public: __thiscall CWorkSpaceDocTemplate::CWorkSpaceDocTemplate(unsigned int,struct CRuntimeClass *,struct CRuntimeClass *,struct CRuntimeClass *)" (??0CWorkSpaceDocTemplate@@QAE@IPAUCRuntimeClass@@00@Z) already defined in ChildFrm.obj as well as the destructor and the other functions i have overloaded? What is causing this? Ryan Baillargeon
The obvious problem is that you have actually defined the routine twice (rare). The usual problem is that you defined the routine in your H file outside of the class scope and didn't make the function "inline". Tim Smith I'm going to patent thought. I have yet to see any prior art.
-
The obvious problem is that you have actually defined the routine twice (rare). The usual problem is that you defined the routine in your H file outside of the class scope and didn't make the function "inline". Tim Smith I'm going to patent thought. I have yet to see any prior art.