Link Error VS2008 - xxxxx already defined in libcpmt.lib

Link Error VS2008 - xxxxx already defined in libcpmt.lib

I have a project that has been working fine with IPP and I've just added a call to ippiResizeSqrPixel_8u_C4R. Now I'm getting the follwoing link errors -

1>libcpmt.lib(locale0.obj) : error LNK2005: "public: static unsigned int __cdecl std::char_traits::length(char const *)" (?length@?$char_traits@D@std@@SAIPBD@Z) already defined in msvcprtd.lib(MSVCP90D.dll)
1>libcpmt.lib(locale0.obj) : error LNK2005: "public: unsigned int __thiscall std::basic_string,class std::allocator >::size(void)const " (?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in msvcprtd.lib(MSVCP90D.dll)
1>libcpmt.lib(locale0.obj) : error LNK2005: "protected: char * __thiscall std::basic_string,class std::allocator >::_Myptr(void)" (?_Myptr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAEPADXZ) already defined in msvcprtd.lib(MSVCP90D.dll)
1>libcpmt.lib(locale0.obj) : error LNK2005: "public: char const * __thiscall std::basic_string,class std::allocator >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) already defined in msvcprtd.lib(MSVCP90D.dll)
1>libcpmt.lib(locale0.obj) : error LNK2005: "public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) already defined in msvcprtd.lib(MSVCP90D.dll)
1>libcpmt.lib(locale0.obj) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in msvcprtd.lib(MSVCP90D.dll)
1>libcpmt.lib(locale0.obj) : error LNK2005: "public: __thiscall std::basic_string,class std::allocator >::basic_string,class std::allocator >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in msvcprtd.lib(MSVCP90D.dll)
1>libcpmt.lib(locale0.obj) : error LNK2005: "public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::operator=(char const *)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) already defined in msvcprtd.lib(MSVCP90D.dll)
.....continues with more of same

My configuration is
Visual Studio 2008SP1. Current version IPP. All modules compiled with /MDd setting. I'm am linking to IPP using static linking with dispatch configuration.

Ipp libraries included -

  • ippsemerged.lib
  • ippsmerged_t.lib
  • ippiemerged.lib
  • ippimerged_t.lib
  • ippcore_t.lib
  • libiomp5mt.lib
  • libircmt.lib

Suggestions as to what I need to do.

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Have you tried cleaning and rebuilding? It appears that one or more C++ files were compiled with /MT rather than /MDd .

Yes. I had considered that and checked all my projects.

Best Reply

have you tried to exclude "msvcprtd.lib" from linking ?

regards, thom

Leave a Comment

Please sign in to add a comment. Not a member? Join today