You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Radovan Chytracek <ra...@gmail.com> on 2005/03/18 02:37:36 UTC

Linker warning LNK4006 problem...

Hi,

   after long time I tried to build our libraries against XercesC on
Windows using MsDev .NET 2003 and I am getting over 13000 these
warnings when creating static library. I was checking all the project
settings but no success. Is there any way to get rid of them?

Thanks

             Radovan

The warnings loook like:

xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006: "public: void
__thiscall xercesc_2_6::BitSet::xorWith(class xercesc_2_6::BitSet
const &)" (?xorWith@BitSet@xercesc_2_6@@QAEXABV12@@Z) already defined
in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition ignored
xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006:
"__declspec(dllimport) public: void __thiscall
xercesc_2_6::BitSet::xorWith(class xercesc_2_6::BitSet const &)"
(__imp_?xorWith@BitSet@xercesc_2_6@@QAEXABV12@@Z) already defined in
xerces-c_2D.lib(xerces-c_2_6D.dll); second definition ignored
xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006: "public: static
unsigned short __cdecl
xercesc_2_6::XMLIBM1140Transcoder::xlatThisOne(unsigned char)"
(?xlatThisOne@XMLIBM1140Transcoder@xercesc_2_6@@SAGE@Z) already
defined in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition
ignored
xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006:
"__declspec(dllimport) public: static unsigned short __cdecl
xercesc_2_6::XMLIBM1140Transcoder::xlatThisOne(unsigned char)"
(__imp_?xlatThisOne@XMLIBM1140Transcoder@xercesc_2_6@@SAGE@Z) already
defined in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition
ignored
xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006: "public: static
unsigned short __cdecl
xercesc_2_6::XMLIBM1047Transcoder::xlatThisOne(unsigned char)"
(?xlatThisOne@XMLIBM1047Transcoder@xercesc_2_6@@SAGE@Z) already
defined in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition
ignored
xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006:
"__declspec(dllimport) public: static unsigned short __cdecl
xercesc_2_6::XMLIBM1047Transcoder::xlatThisOne(unsigned char)"
(__imp_?xlatThisOne@XMLIBM1047Transcoder@xercesc_2_6@@SAGE@Z) already
defined in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition
ignored
xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006: "public: static
unsigned short __cdecl
xercesc_2_6::XMLEBCDICTranscoder::xlatThisOne(unsigned char)"
(?xlatThisOne@XMLEBCDICTranscoder@xercesc_2_6@@SAGE@Z) already defined
in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition ignored


-- 
Radovan Chytracek
mailto:Radovan.Chytracek@cern.ch

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Linker warning LNK4006 problem...

Posted by Radovan Chytracek <ra...@gmail.com>.
Hi Alberto,

   I took official XercesC zip distribution and compiled using MsDev
solution which BTW needed to  be converted to the latest format. Once
having these XercesC libraries in place I created my new solution and
static library project for my sources and tried to build. I knew the
issues with mixing run-times from the past so I paid attention and set
them different for Debug and Release builds.

Looking at the MSDN I have found that these warnings may come due to
/Gy function level linking switch. I saw this is being used by
executable targets in XercesC examples but setting it off or on in my
static library project had no effect.

What are the recommended settings to build a client library using
XercesC lib files? I saw some preprocessor definitions to switch
dllexport or dllimport and I remember using these in our project
settings from the past with MsDev VC++ 6.0 now with MsDev .NET 2003
VC++ 7.1 I used them as well but not a big success. I get my library
built, it just takes a long time till MsDev dumps out all the warning
messages.

Cheers

              Radovan

On Fri, 18 Mar 2005 10:04:17 +0100, Alberto Massari
<am...@datadirect.com> wrote:
> Hi Radovan,
> 
> At 02.37 18/03/2005 +0100, Radovan Chytracek wrote:
> >Hi,
> >
> >    after long time I tried to build our libraries against XercesC on
> >Windows using MsDev .NET 2003 and I am getting over 13000 these
> >warnings when creating static library. I was checking all the project
> >settings but no success. Is there any way to get rid of them?
> 
> The error messages list xerces-c_2_6D.dll, but there is no
> _dllimport/_dllexport in the function signature; did you modify the Xerces
> project or header files?
> If you are the sources from CVS (vs using the official 2.6 release) can you
> try building Xerces as a static library (by selecting the "Static Build"
> configuration)?
> 
> Alberto
> 
> >The warnings loook like:
> >
> >xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006: "public: void
> >__thiscall xercesc_2_6::BitSet::xorWith(class xercesc_2_6::BitSet
> >const &)" (?xorWith@BitSet@xercesc_2_6@@QAEXABV12@@Z) already defined
> >in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition ignored
> >xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006:
> >"__declspec(dllimport) public: void __thiscall
> >xercesc_2_6::BitSet::xorWith(class xercesc_2_6::BitSet const &)"
> >(__imp_?xorWith@BitSet@xercesc_2_6@@QAEXABV12@@Z) already defined in
> >xerces-c_2D.lib(xerces-c_2_6D.dll); second definition ignored
> >xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006: "public: static
> >unsigned short __cdecl
> >xercesc_2_6::XMLIBM1140Transcoder::xlatThisOne(unsigned char)"
> >(?xlatThisOne@XMLIBM1140Transcoder@xercesc_2_6@@SAGE@Z) already
> >defined in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition
> >ignored
> >xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006:
> >"__declspec(dllimport) public: static unsigned short __cdecl
> >xercesc_2_6::XMLIBM1140Transcoder::xlatThisOne(unsigned char)"
> >(__imp_?xlatThisOne@XMLIBM1140Transcoder@xercesc_2_6@@SAGE@Z) already
> >defined in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition
> >ignored
> >xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006: "public: static
> >unsigned short __cdecl
> >xercesc_2_6::XMLIBM1047Transcoder::xlatThisOne(unsigned char)"
> >(?xlatThisOne@XMLIBM1047Transcoder@xercesc_2_6@@SAGE@Z) already
> >defined in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition
> >ignored
> >xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006:
> >"__declspec(dllimport) public: static unsigned short __cdecl
> >xercesc_2_6::XMLIBM1047Transcoder::xlatThisOne(unsigned char)"
> >(__imp_?xlatThisOne@XMLIBM1047Transcoder@xercesc_2_6@@SAGE@Z) already
> >defined in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition
> >ignored
> >xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006: "public: static
> >unsigned short __cdecl
> >xercesc_2_6::XMLEBCDICTranscoder::xlatThisOne(unsigned char)"
> >(?xlatThisOne@XMLEBCDICTranscoder@xercesc_2_6@@SAGE@Z) already defined
> >in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition ignored
> >
> >
> >--
> >Radovan Chytracek
> >mailto:Radovan.Chytracek@cern.ch
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> >For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 
> 


-- 
Radovan Chytracek
mailto:Radovan.Chytracek@cern.ch

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Linker warning LNK4006 problem...

Posted by Alberto Massari <am...@datadirect.com>.
Hi Radovan,

At 02.37 18/03/2005 +0100, Radovan Chytracek wrote:
>Hi,
>
>    after long time I tried to build our libraries against XercesC on
>Windows using MsDev .NET 2003 and I am getting over 13000 these
>warnings when creating static library. I was checking all the project
>settings but no success. Is there any way to get rid of them?

The error messages list xerces-c_2_6D.dll, but there is no 
_dllimport/_dllexport in the function signature; did you modify the Xerces 
project or header files?
If you are the sources from CVS (vs using the official 2.6 release) can you 
try building Xerces as a static library (by selecting the "Static Build" 
configuration)?

Alberto

>The warnings loook like:
>
>xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006: "public: void
>__thiscall xercesc_2_6::BitSet::xorWith(class xercesc_2_6::BitSet
>const &)" (?xorWith@BitSet@xercesc_2_6@@QAEXABV12@@Z) already defined
>in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition ignored
>xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006:
>"__declspec(dllimport) public: void __thiscall
>xercesc_2_6::BitSet::xorWith(class xercesc_2_6::BitSet const &)"
>(__imp_?xorWith@BitSet@xercesc_2_6@@QAEXABV12@@Z) already defined in
>xerces-c_2D.lib(xerces-c_2_6D.dll); second definition ignored
>xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006: "public: static
>unsigned short __cdecl
>xercesc_2_6::XMLIBM1140Transcoder::xlatThisOne(unsigned char)"
>(?xlatThisOne@XMLIBM1140Transcoder@xercesc_2_6@@SAGE@Z) already
>defined in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition
>ignored
>xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006:
>"__declspec(dllimport) public: static unsigned short __cdecl
>xercesc_2_6::XMLIBM1140Transcoder::xlatThisOne(unsigned char)"
>(__imp_?xlatThisOne@XMLIBM1140Transcoder@xercesc_2_6@@SAGE@Z) already
>defined in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition
>ignored
>xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006: "public: static
>unsigned short __cdecl
>xercesc_2_6::XMLIBM1047Transcoder::xlatThisOne(unsigned char)"
>(?xlatThisOne@XMLIBM1047Transcoder@xercesc_2_6@@SAGE@Z) already
>defined in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition
>ignored
>xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006:
>"__declspec(dllimport) public: static unsigned short __cdecl
>xercesc_2_6::XMLIBM1047Transcoder::xlatThisOne(unsigned char)"
>(__imp_?xlatThisOne@XMLIBM1047Transcoder@xercesc_2_6@@SAGE@Z) already
>defined in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition
>ignored
>xerces-c_2D.lib(xerces-c_2_6D.dll) : warning LNK4006: "public: static
>unsigned short __cdecl
>xercesc_2_6::XMLEBCDICTranscoder::xlatThisOne(unsigned char)"
>(?xlatThisOne@XMLEBCDICTranscoder@xercesc_2_6@@SAGE@Z) already defined
>in xerces-c_2D.lib(xerces-c_2_6D.dll); second definition ignored
>
>
>--
>Radovan Chytracek
>mailto:Radovan.Chytracek@cern.ch
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org