B
Bret Pehrson
Try this one on for size:
// Managed C++ Project/code
#pragma unmanaged
struct S
{
};
void Func()
{
try
{
}
catch (S * s)
{
}
}
#pragma managed
When compiled, produces the following:
LINK : error LNK2020: unresolved token (0A000013) ??_7type_info@@6B@
Poking around in the generated .obj file w/ ildasm for token 0A000013 reveals
the following:
// MemberRef #9
// -------------------------------------------------------
// Member: (0a000013) __CxxUnregisterExceptionObject:
// CallCnvntn: [DEFAULT]
// ReturnType: CMOD_OPT System.Runtime.CompilerServices.CallConvCdecl Void
// 2 Arguments
// Argument #1: Ptr Void
// Argument #2: I4
// CustomAttribute #1 (0c000013)
// -------------------------------------------------------
// CustomAttribute Type: 0a00000c
// CustomAttributeName: Microsoft.VisualC.DecoratedNameAttribute :: instance
void .ctor(class System.String)
// Length: 51
// Value : 01 00 2e 3f 5f 5f 43 78 78 55 6e 72 65 67 69 73 >
..?__CxxUnregis<
// : 74 65 72 45 78 63 65 70 74 69 6f 6e 4f 62
6a 65 >terExceptionObje<
// : 63 74 40 40 24 24 4a 30 59 41 58 50 41 58
48 40 >ct@@$$J0YAXPAXH@<
// : 5a 00
00 >Z <
// ctor args: ("?__CxxUnregisterExceptionObject@@$$J0YAXPAXH@Z")
//
Obviously, __CxxUnregisterExceptionObject isn't something that I've defined,
but is a core component that appears to be missing. Yes, C++ exceptions are
enabled for the project...
Anyone seen this, and how they resolved it?
// Managed C++ Project/code
#pragma unmanaged
struct S
{
};
void Func()
{
try
{
}
catch (S * s)
{
}
}
#pragma managed
When compiled, produces the following:
LINK : error LNK2020: unresolved token (0A000013) ??_7type_info@@6B@
Poking around in the generated .obj file w/ ildasm for token 0A000013 reveals
the following:
// MemberRef #9
// -------------------------------------------------------
// Member: (0a000013) __CxxUnregisterExceptionObject:
// CallCnvntn: [DEFAULT]
// ReturnType: CMOD_OPT System.Runtime.CompilerServices.CallConvCdecl Void
// 2 Arguments
// Argument #1: Ptr Void
// Argument #2: I4
// CustomAttribute #1 (0c000013)
// -------------------------------------------------------
// CustomAttribute Type: 0a00000c
// CustomAttributeName: Microsoft.VisualC.DecoratedNameAttribute :: instance
void .ctor(class System.String)
// Length: 51
// Value : 01 00 2e 3f 5f 5f 43 78 78 55 6e 72 65 67 69 73 >
..?__CxxUnregis<
// : 74 65 72 45 78 63 65 70 74 69 6f 6e 4f 62
6a 65 >terExceptionObje<
// : 63 74 40 40 24 24 4a 30 59 41 58 50 41 58
48 40 >ct@@$$J0YAXPAXH@<
// : 5a 00
00 >Z <
// ctor args: ("?__CxxUnregisterExceptionObject@@$$J0YAXPAXH@Z")
//
Obviously, __CxxUnregisterExceptionObject isn't something that I've defined,
but is a core component that appears to be missing. Yes, C++ exceptions are
enabled for the project...
Anyone seen this, and how they resolved it?