C++/CLI 64-bit fails with link error 2022
I have a 64-bit C++/CLI project compiled with /clr:pure
When building I get the following errors:
1>AssemblyInfo.obj : error LNK2022: metadata operation failed (80131195) : Custom attributes are not consistent: (0x0c00003f).
1>AssemblyInfo.obj : error LNK2022: metadata operation failed (80131195) : Custom attributes are not consistent: (0x0c000044).
I followed the guide here and used ILDASM
to export the metadata for the id's in the errors.
// Method #20 (06000014)
// -------------------------------------------------------
// MethodName: atexit (06000014)
// Flags : [Assem] [Static] [ReuseSlot] (00000013)
// RVA : 0x00000000
// ImplFlags : [IL] [Managed] [ForwardRef] (00000010)
// CallCnvntn: [DEFAULT]
// ReturnType: I4
// 1 Arguments
// Argument #1: FNPTR [DEFAULT] Void( )
// 1 Parameters
// (1) ParamToken : (08000013) Name : _Function flags: [none] (00000000)
// CustomAttribute #1 (0c000044)
// --------------------------------------------------开发者_Go百科-----
// CustomAttribute Type: 0a00000a
// CustomAttributeName: System.Security.SecurityCriticalAttribute :: instance void .ctor()
// Length: 4
// Value : 01 00 00 00 > <
// ctor args: ()
(and a similar entry for the other error)
The article then says Armed with that, you can go back to your source files and determine why the type (class/struct) is being defined differently in the different source files.
Can someone explain whay I should look for?
精彩评论