Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Linker Error

Linker Error

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++help
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ryan B
    wrote on last edited by
    #1

    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

    R T 2 Replies Last reply
    0
    • R Ryan B

      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

      R Offline
      R Offline
      RobJones
      wrote on last edited by
      #2

      Did you overloaded these functions with the Class Wizzard or did you write the functions manually? If you did them manually maybe you're missing something, I would go back and overload them using the wizzard.. Not sure just an idea..

      1 Reply Last reply
      0
      • R Ryan B

        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

        T Offline
        T Offline
        Tim Smith
        wrote on last edited by
        #3

        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.

        R 1 Reply Last reply
        0
        • T Tim Smith

          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.

          R Offline
          R Offline
          Ryan B
          wrote on last edited by
          #4

          ... speechless (takes brick and smashes over head) ... thank you Ryan Baillargeon

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups