Visual studio Link error.

Tech-Archive recommends: Speed Up your PC by fixing your registry



On Visual Studio .Net, I compiled the XMP-SDK library provided
by Adobe. The lib file appeared as expected in
C:\XMP-SDK\XMP-SDK\public\libraries\windows\debug\XMPCore.lib.

I then tried linking my program (Aardplugin) with
this library. I went to project->properties->Linker->Input
and added XMPCore.lib as an addition dependency. I then
went to project->properties->Linker->General and added
C:\XMP-SDK\XMP-SDK\public\libraries\windows\debug as an
Additional Library Directory. When I linked, I got
the following messages:

XMPCore.lib(XMP_Impl.obj) : error LNK2005: "void __cdecl operator
delete(void *)" (??3@YAXPAX@Z) already defined in
msvcrtd.lib(MSVCR71D.dll)
XMPCore.lib(XMP_Impl.obj) : error LNK2005: "void __cdecl operator
delete[](void *)" (??_V@YAXPAX@Z) already defined in
msvcrtd.lib(MSVCR71D.dll)
XMPCore.lib(XMP_Impl.obj) : warning LNK4006: "void __cdecl operator
delete(void *)" (??3@YAXPAX@Z) already defined in
msvcrtd.lib(MSVCR71D.dll); second definition ignored
XMPCore.lib(XMP_Impl.obj) : warning LNK4006: "void __cdecl operator
delete[](void *)" (??_V@YAXPAX@Z) already defined in
msvcrtd.lib(MSVCR71D.dll); second definition ignored

The actual linker command line looks like:

/OUT:"Debug/Aardplugin.dll" /INCREMENTAL /NOLOGO
/LIBPATH:"C:\XMP-SDK\XMP-SDK\public\libraries\windows\debug"
/DLL /DEF:".\Aardplugin.def" /DEBUG /ASSEMBLYDEBUG
/PDB:"Debug/Aardplugin.pdb" /SUBSYSTEM:WINDOWS /NOENTRY
/IMPLIB:"Debug/Aardplugin.lib" /MACHINE:X86 XMPCore.lib
"\Xmp-sdk\Xmp-sdk\public\libraries\windows\debug\XMPCore.lib"

I have no clue where the second full path XMPCore.lib line came from,
but I did not expect this.

I looked around on the net and found this page:

http://support.microsoft.com/default.aspx?scid=kb;en-us;q148652

and so I tried Solution 1 with msvcrtd.lib. I still got the same
errors.
So I set /verbose:lib, and found the following:

Searching C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\lib\msvcrtd.lib:
Searching
C:\XMP-SDK\XMP-SDK\public\libraries\windows\debug\XMPCore.lib:
XMPCore.lib(XMP_Impl.obj) : error LNK2005: "void * __cdecl operator
new(unsigned int)" (??2@YAPAXI@Z) already defined in
msvcrtd.lib(MSVCR71D.dll)
XMPCore.lib(XMP_Impl.obj) : error LNK2005: "void __cdecl operator
delete(void *)" (??3@YAXPAX@Z) already defined in
msvcrtd.lib(MSVCR71D.dll)
XMPCore.lib(XMP_Impl.obj) : error LNK2005: "void __cdecl operator
delete[](void *)" (??_V@YAXPAX@Z) already defined in
msvcrtd.lib(MSVCR71D.dll)
Searching
\Xmp-sdk\Xmp-sdk\public\libraries\windows\debug\XMPCore.lib:


So it does appear that the link error is with XMPCore.lib. So I do
have some sort of
problem there. However, does anyone out there know where the
\Xmp-sdk...XMPCore.lib
line comes from?

Thanks

.



Relevant Pages