c++-cli - obj 文件中的元数据标记是什么?
问题描述
我遇到了 c++ cli 的链接器错误:
错误 LNK2022 元数据操作失败(80131195):自定义属性不一致:(0x0c00019d)。foo.obj 1
错误 LNK2022 元数据操作失败(80131195):自定义属性不一致:(0x0c0001ab)。bar.obj 1
什么是元数据令牌?我已经通过 学习了 obj 文件ildasm
,但我不知道真正的问题是什么。以下是简要内容:
foo.obj:
// TypeDef #190 (020000bf)
// -------------------------------------------------------
// TypDefName: FooClass (020000BF)
// Flags : [Public] [SequentialLayout] [Class] [Sealed] [AnsiClass] [BeforeFieldInit] (00100109)
// Extends : 01000017 [TypeRef] System.ValueType
// Layout : Packing:0, Size:12
// CustomAttribute #1 (0c00019c)
// -------------------------------------------------------
// CustomAttribute Type: 0a000006
// CustomAttributeName: System.Runtime.CompilerServices.NativeCppClassAttribute :: instance void .ctor()
// Length: 4
// Value : 01 00 00 00 > <
// ctor args: ()
//
// CustomAttribute #2 (0c00019d)
// -------------------------------------------------------
// CustomAttribute Type: 0a000007
// CustomAttributeName: System.CLSCompliantAttribute :: instance void .ctor(bool)
// Length: 5
// Value : 01 00 00 00 00 > <
// ctor args: ( <can not decode> )
bar.obj
// TypeDef #199 (020000c8)
// -------------------------------------------------------
// TypDefName: FooClass (020000C8)
// Flags : [Public] [SequentialLayout] [Class] [Sealed] [AnsiClass] [BeforeFieldInit] (00100109)
// Extends : 01000016 [TypeRef] System.ValueType
// Layout : Packing:0, Size:12
// CustomAttribute #1 (0c0001aa)
// -------------------------------------------------------
// CustomAttribute Type: 0a000006
// CustomAttributeName: System.Runtime.CompilerServices.NativeCppClassAttribute :: instance void .ctor()
// Length: 4
// Value : 01 00 00 00 > <
// ctor args: ()
//
// CustomAttribute #2 (0c0001ab)
// -------------------------------------------------------
// CustomAttribute Type: 0a000007
// CustomAttributeName: System.CLSCompliantAttribute :: instance void .ctor(bool)
// Length: 5
// Value : 01 00 00 00 00 > <
// ctor args: ( <can not decode> )
我所看到的,FooClass 扩展了不同的 ValueTypes(我不知道为什么)。是否有关于该令牌的任何文档?是关于符号的某种 pdb 信息吗?
解决方案
推荐阅读
- python - 打印ÆØÅ(大写)字母
- javascript - 在抓取一些表格数据时得到奇怪的输出
- sql - 使用 SQL 的自联接查询 - 附加了演示查询
- r - 根据R中的单独列标记列中值的第一次连续出现
- json - 用逗号格式化的 JSON 数字
- ios - 如果另一个 UITextField 具有特定值,则启用特定 UITextField
- php - php dyld:未为 libldap 加载库
- javascript - 如何模拟 ajax 响应
- amazon-web-services - Jenkins 重置 AWS 密码的作业
- python - 组合按列中的值分组的 2d numpy 数组