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. COM
  4. Getting link error

Getting link error

Scheduled Pinned Locked Moved COM
helpc++question
9 Posts 2 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.
  • G Offline
    G Offline
    gtag
    wrote on last edited by
    #1

    I am using following dll's in VC++ mso.dll vbe6ext.olb namespace Office comutil I am getting following build errors: Error 96 error LNK2005: "void __stdcall _set_com_error_handler(void (__stdcall*)(long,struct IErrorInfo *))" (?_set_com_error_handler@@YGXP6GXJPAUIErrorInfo@@@Z@Z) already defined in comsupp.lib(comsupp.obj) comsuppwd.lib Error 97 error LNK2005: "void __stdcall _com_issue_error(long)" (?_com_issue_error@@YGXJ@Z) already defined in comsupp.lib(comsupp.obj) comsuppwd.lib Error 98 error LNK2005: "void __stdcall _com_issue_errorex(long,struct IUnknown *,struct _GUID const &)" (?_com_issue_errorex@@YGXJPAUIUnknown@@ABU_GUID@@@Z) already defined in comsupp.lib(comsupp.obj) comsuppwd.lib Error 99 error LNK2005: "long __stdcall _com_dispatch_propget(struct IDispatch *,long,unsigned short,void *)" (?_com_dispatch_propget@@YGJPAUIDispatch@@JGPAX@Z) already defined in comsupp.lib(comsupp.obj) comsuppwd.lib Error 100 error LNK2005: "long __cdecl _com_dispatch_propput(struct IDispatch *,long,unsigned short,...)" (?_com_dispatch_propput@@YAJPAUIDispatch@@JGZZ) already defined in comsupp.lib(comsupp.obj) comsuppwd.lib Error 101 error LNK2005: "void (__stdcall* __errorPfn)(long,struct IErrorInfo *)" (?__errorPfn@@3P6GXJPAUIErrorInfo@@@ZA) already defined in comsupp.lib(comsupp.obj) comsuppwd.lib Error 102 error LNK2005: "long __stdcall _com_dispatch_raw_propget(struct IDispatch *,long,unsigned short,void *)" (?_com_dispatch_raw_propget@@YGJPAUIDispatch@@JGPAX@Z) already defined in comsupp.lib(invkprxy.obj) comsuppwd.lib Error 103 error LNK2005: "long __cdecl _com_dispatch_raw_propput(struct IDispatch *,long,unsigned short,...)" (?_com_dispatch_raw_propput@@YAJPAUIDispatch@@JGZZ) already defined in comsupp.lib(invkprxy.obj) comsuppwd.lib Error 104 fatal error LNK1169: one or more multiply defined symbols found Please give me clue to solve this issue. I am new to VC++ stuff. Thanks in advance. Regards, Gtag

    S 1 Reply Last reply
    0
    • G gtag

      I am using following dll's in VC++ mso.dll vbe6ext.olb namespace Office comutil I am getting following build errors: Error 96 error LNK2005: "void __stdcall _set_com_error_handler(void (__stdcall*)(long,struct IErrorInfo *))" (?_set_com_error_handler@@YGXP6GXJPAUIErrorInfo@@@Z@Z) already defined in comsupp.lib(comsupp.obj) comsuppwd.lib Error 97 error LNK2005: "void __stdcall _com_issue_error(long)" (?_com_issue_error@@YGXJ@Z) already defined in comsupp.lib(comsupp.obj) comsuppwd.lib Error 98 error LNK2005: "void __stdcall _com_issue_errorex(long,struct IUnknown *,struct _GUID const &)" (?_com_issue_errorex@@YGXJPAUIUnknown@@ABU_GUID@@@Z) already defined in comsupp.lib(comsupp.obj) comsuppwd.lib Error 99 error LNK2005: "long __stdcall _com_dispatch_propget(struct IDispatch *,long,unsigned short,void *)" (?_com_dispatch_propget@@YGJPAUIDispatch@@JGPAX@Z) already defined in comsupp.lib(comsupp.obj) comsuppwd.lib Error 100 error LNK2005: "long __cdecl _com_dispatch_propput(struct IDispatch *,long,unsigned short,...)" (?_com_dispatch_propput@@YAJPAUIDispatch@@JGZZ) already defined in comsupp.lib(comsupp.obj) comsuppwd.lib Error 101 error LNK2005: "void (__stdcall* __errorPfn)(long,struct IErrorInfo *)" (?__errorPfn@@3P6GXJPAUIErrorInfo@@@ZA) already defined in comsupp.lib(comsupp.obj) comsuppwd.lib Error 102 error LNK2005: "long __stdcall _com_dispatch_raw_propget(struct IDispatch *,long,unsigned short,void *)" (?_com_dispatch_raw_propget@@YGJPAUIDispatch@@JGPAX@Z) already defined in comsupp.lib(invkprxy.obj) comsuppwd.lib Error 103 error LNK2005: "long __cdecl _com_dispatch_raw_propput(struct IDispatch *,long,unsigned short,...)" (?_com_dispatch_raw_propput@@YAJPAUIDispatch@@JGZZ) already defined in comsupp.lib(invkprxy.obj) comsuppwd.lib Error 104 fatal error LNK1169: one or more multiply defined symbols found Please give me clue to solve this issue. I am new to VC++ stuff. Thanks in advance. Regards, Gtag

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      Well, you're including multiple versions of the COM support library - I see comsupp.lib and comsuppwd.lib for a start. You need to examine your project settings to see where the libraries are being pulled into your project. I presume you're using #import to interface to mso.dll and vbe6ext.olb? How are you 'using' comutil, by the way?

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      G 1 Reply Last reply
      0
      • S Stuart Dootson

        Well, you're including multiple versions of the COM support library - I see comsupp.lib and comsuppwd.lib for a start. You need to examine your project settings to see where the libraries are being pulled into your project. I presume you're using #import to interface to mso.dll and vbe6ext.olb? How are you 'using' comutil, by the way?

        Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

        G Offline
        G Offline
        gtag
        wrote on last edited by
        #3

        #import \ "C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE12\mso.dll"\ rename("DocumentProperties", "DocumentPropertiesXL"),\ rename("RGB", "RBGXL") //Microsoft VBA Objects #import \ "C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBA6\vbe6ext.olb"raw_interfaces_only,\ rename("Reference","ignorethis"),rename("VBE","XLVBE") //Excel Application Objects #import "C:\Program Files (x86)\Microsoft Office\Office12\EXCEL.EXE"\ rename("DialogBox", "DialogBoxXL"),rename("RGB", "RBGXL"),\ rename("DocumentProperties", "DocumentPropertiesXL"),\ rename("ReplaceText", "ReplaceTextXL"),\ rename("FindText", "FindTextXL"),\ rename("CopyFile", "CopyFileXL"),\ rename("VBE","XLVBE"),\ exclude("IFont", "IPicture") no_dual_interfaces In property pages->linker->input -->additional dependencies i mentioned comsuppw.lib and comsupp.lib. Please tell me what and all I need to check in project settings. #include "comutil.h" #pragma comment(lib, "comsuppw.lib")

        S 1 Reply Last reply
        0
        • G gtag

          #import \ "C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE12\mso.dll"\ rename("DocumentProperties", "DocumentPropertiesXL"),\ rename("RGB", "RBGXL") //Microsoft VBA Objects #import \ "C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBA6\vbe6ext.olb"raw_interfaces_only,\ rename("Reference","ignorethis"),rename("VBE","XLVBE") //Excel Application Objects #import "C:\Program Files (x86)\Microsoft Office\Office12\EXCEL.EXE"\ rename("DialogBox", "DialogBoxXL"),rename("RGB", "RBGXL"),\ rename("DocumentProperties", "DocumentPropertiesXL"),\ rename("ReplaceText", "ReplaceTextXL"),\ rename("FindText", "FindTextXL"),\ rename("CopyFile", "CopyFileXL"),\ rename("VBE","XLVBE"),\ exclude("IFont", "IPicture") no_dual_interfaces In property pages->linker->input -->additional dependencies i mentioned comsuppw.lib and comsupp.lib. Please tell me what and all I need to check in project settings. #include "comutil.h" #pragma comment(lib, "comsuppw.lib")

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          Your #imports are fine. I've just looked at a project of mine that #imports Excel and I don't #include comutil.h and I don't mention comsupp or comsuppw at all. In fact, after some investigation, I can say that you don't need to mention them at all. The .tlh file created by the #import includes comdef.h, which in turn a) #includes comutil.h and b) uses #pragma comment to reference the correct comsupp_xx_ library. So to fix your issue, get rid of your #pragma comments and get rid of references to comsupp_xx_ libraries in your linker input properties.

          Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

          G 1 Reply Last reply
          0
          • S Stuart Dootson

            Your #imports are fine. I've just looked at a project of mine that #imports Excel and I don't #include comutil.h and I don't mention comsupp or comsuppw at all. In fact, after some investigation, I can say that you don't need to mention them at all. The .tlh file created by the #import includes comdef.h, which in turn a) #includes comutil.h and b) uses #pragma comment to reference the correct comsupp_xx_ library. So to fix your issue, get rid of your #pragma comments and get rid of references to comsupp_xx_ libraries in your linker input properties.

            Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

            G Offline
            G Offline
            gtag
            wrote on last edited by
            #5

            Hi, Thank you. I have removed from linker and removed #includes even. Project is building but basic functionality is not working. I can put this way: I have one VC++ application built on older version which includes macros and these macros functionality depend on some lib which uses comsupp.lib I guess. Now I have to add some function to read excel data which uses mso.dll and other libraries which I mentioned , these use comsuppw.lib. Both the things I need but if I am removing reference to comsupp.dll macros functionality is not working. Is there any way to make both the things working using single com dll. Thanks in advance. Regards, Gtag

            S 1 Reply Last reply
            0
            • G gtag

              Hi, Thank you. I have removed from linker and removed #includes even. Project is building but basic functionality is not working. I can put this way: I have one VC++ application built on older version which includes macros and these macros functionality depend on some lib which uses comsupp.lib I guess. Now I have to add some function to read excel data which uses mso.dll and other libraries which I mentioned , these use comsuppw.lib. Both the things I need but if I am removing reference to comsupp.dll macros functionality is not working. Is there any way to make both the things working using single com dll. Thanks in advance. Regards, Gtag

              S Offline
              S Offline
              Stuart Dootson
              wrote on last edited by
              #6

              The only difference between comsupp and comsuppw is that comsupp uses ASCII strings, comsuppw uses wide character strings. Anyway - it's very hard to suggest ANYTHING when the only statement you've given is 'functionality is not working'.

              Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

              G 1 Reply Last reply
              0
              • S Stuart Dootson

                The only difference between comsupp and comsuppw is that comsupp uses ASCII strings, comsuppw uses wide character strings. Anyway - it's very hard to suggest ANYTHING when the only statement you've given is 'functionality is not working'.

                Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                G Offline
                G Offline
                gtag
                wrote on last edited by
                #7

                I am retrying the same thing, want to make sure that only bcoz of linker reference its not working or any other reason. Hey please suggest if you know any other way, I am ready to do R and D. Pleasee.

                S 1 Reply Last reply
                0
                • G gtag

                  I am retrying the same thing, want to make sure that only bcoz of linker reference its not working or any other reason. Hey please suggest if you know any other way, I am ready to do R and D. Pleasee.

                  S Offline
                  S Offline
                  Stuart Dootson
                  wrote on last edited by
                  #8

                  Well - as I said, the only difference between comsupp and comsuppw is the string/character type they use - seems to me that maybe you've probably got an issue with string handling somewhere.

                  Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                  G 1 Reply Last reply
                  0
                  • S Stuart Dootson

                    Well - as I said, the only difference between comsupp and comsuppw is the string/character type they use - seems to me that maybe you've probably got an issue with string handling somewhere.

                    Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                    G Offline
                    G Offline
                    gtag
                    wrote on last edited by
                    #9

                    Hey its working. Now even functionality is working perfectly. There was some problem in previous old application, I resolved it. Thank you very much. Regards, Gtag

                    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