I'm having a new-to-me linker error in a project I'm working with:
1>MSVCMRTD.lib(locale0_implib.obj) : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (std.basic_string<char,std::char_traits<char>,std::allocator<char> >): (0x0200004e).
1>MSVCMRTD.lib(locale0_implib.obj) : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (std.basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >): (0x02000075).
1>MSVCMRTD.lib(locale0_implib.obj) : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (std._String_iterator<char,std::char_traits<char>,std::allocator<char> >): (0x02000091).
1>MSVCMRTD.lib(locale0_implib.obj) : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (std._String_const_iterator<char,std::char_traits<char>,std::allocator<char> >): (0x02000092).
1>MSVCMRTD.lib(locale0_implib.obj) : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (std._String_val<char,std::allocator<char> >): (0x02000097).
1>MSVCMRTD.lib(locale0_implib.obj) : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (std._String_val<wchar_t,std::allocator<wchar_t> >): (0x02000099).
We're using Visual Studio 2010 in Windows 7.
This project used to compile. It's a C++/CLI DLL wrapper around some unmanaged code, and thus includes Common Language Runtime Support. The thing that has changed is that an external static library that we linked to was "updated". We're now getting this error when we try to compile the project that links to it.
Microsoft's "help" for this issue is to "run ildasm –tokens on the object files to find which types have the tokens listed in error_message, and look for differences". Then I checked this page and noticed that the /tokens
option is only valid for .exe and .dll files... but this is a linker error, so my .dll file isn't made yet!
I've tried running things like ildasm -tokens AssemblyInfo.obj
, but the only thing that happens is that a window opens up with this incredibly helpful error message:
Thanks Microsoft!
I'm not really sure how to continue troubleshooting this issue. A Release build works properly -- it's only the Debug that's messed up. So somewhere in the mix I guess the std::string
type is of a different size or something...
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…