Getting link error
-
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
-
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
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
-
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
#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")
-
#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")
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
-
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
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
-
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
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
-
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
-
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.
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
-
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