【发布时间】:2011-04-06 22:49:28
【问题描述】:
很抱歉用这个问题打扰任何人,但我已经研究了几个小时,还没有解决方案:
我正在将一个相当庞大的应用程序移植到 Visual Studio 2010 中的 10.0 CRT(编译器)。该应用程序是使用 /clr 的托管 C++/CLI。大部分代码是本机代码 (95%),其中有一些托管部分。
所以我的工作是在 .vcxproj 中进行切换以针对较新的 10.0 CRT(即编译器)。我们之前使用的是 v90,或者使用的是 VS 2008 SP1 附带的 VC 编译器。
好的,那么重大更改?好像真的是一堆。我修复了一些处理集合的迭代器问题,这一切都很容易。
但是这些链接器错误正在杀死我。任何帮助将不胜感激:
1>MSVCMRTD.lib(locale0_implib.obj) : error LNK2022: metadata operation failed (80131195) : Custom attributes are not consistent: (0x0c0001c0).
1>MSVCMRTD.lib(locale0_implib.obj) : error LNK2022: metadata operation failed (80131195) : Custom attributes are not consistent: (0x0c0001c5).
...
1>MSVCMRTD.lib(locale0_implib.obj) : error LNK2034: metadata inconsistent with COFF symbol table: symbol '??0?$allocator@D@std@@$$FQAE@ABV01@@Z' (06000141) has inconsistent metadata with (0A000F75) in identity.obj
1>MSVCMRTD.lib(locale0_implib.obj) : error LNK2034: metadata inconsistent with COFF symbol table: symbol '??0?$allocator@D@std@@$$FQAE@ABV01@@Z' (06000141) has inconsistent metadata with (0A000F76) in ICustAttribCollapseManagerImp.obj
... (repeated hundreds of times)
我继续并没有装饰符号:
??0?$allocator@D@std@@$$FQAE@ABV01@@Z
得到:
public: __thiscall std::allocator<char>::allocator<char>(class std::allocator<char> const &)
因此,据我了解,msvcmrtd.lib 文件以一种方式编译了此 std::allocator,而我的项目设置中的其他内容(#pragma managed ??)以另一种不同的方式编译。但如果是这样,我要寻找什么?使用旧编译器多年来一直可以很好地编译。
注意: 我们目前是 3.5 .NET 框架(不确定这是否有帮助......我对此表示怀疑)
谢谢
【问题讨论】:
标签: windows visual-studio-2010 winapi stl linker-errors