B
Bret Pehrson
Ok, here is a real *nice* one... Fortunately, I didn't waste too much time on
this one, but a real piece of crap to say the least:
Try out this piece of code (managed C++):
//begin code
class ManagedCPPException
{
};
__gc class ClassManagedCPP
{
void DoException()
{
throw new ManagedCPPException();
}
};
//end code
Compile, and you get this WONDERFUL error:
LINK : error LNK2020: unresolved token (0A000012) ??_7type_info@@6B@
Ok... very informative. Ah, I'll just look it up in the online help
(searching...)
[help]
unresolved token 'token'
Similar to an undefined external error, except that the reference is via
metadata.
To resolve:
Define the missing function or data, or
Include the object file or library in which the missing function or data is
already defined.
[end help]
Oh, boy, even more informative. Now tell me something I *don't* know....
Was finally able to whittle down my code, little by little until I figured out
the error.
I need to prefix the exception class w/ __gc, such as:
__gc class ManagedCPPException
Then everything comiles and links as expected.
Two suggestions to Microsoft:
1) Fix the stupid linker to output better (read: more informative) error
messages, and stop already w/ the hex and mangled crap in the message.
2) Fire your documentation staff. Your online help files for compiler and
linker errors really blows chunks.
For crap sakes, I spent 2 grand for VS.NET, and $100 says the MS response to
this message is "this issue will be addressed in an upcoming release (whidbey)"
-- nice, I'm going to have to plop down another 2 g's for that...
this one, but a real piece of crap to say the least:
Try out this piece of code (managed C++):
//begin code
class ManagedCPPException
{
};
__gc class ClassManagedCPP
{
void DoException()
{
throw new ManagedCPPException();
}
};
//end code
Compile, and you get this WONDERFUL error:
LINK : error LNK2020: unresolved token (0A000012) ??_7type_info@@6B@
Ok... very informative. Ah, I'll just look it up in the online help
(searching...)
[help]
unresolved token 'token'
Similar to an undefined external error, except that the reference is via
metadata.
To resolve:
Define the missing function or data, or
Include the object file or library in which the missing function or data is
already defined.
[end help]
Oh, boy, even more informative. Now tell me something I *don't* know....
Was finally able to whittle down my code, little by little until I figured out
the error.
I need to prefix the exception class w/ __gc, such as:
__gc class ManagedCPPException
Then everything comiles and links as expected.
Two suggestions to Microsoft:
1) Fix the stupid linker to output better (read: more informative) error
messages, and stop already w/ the hex and mangled crap in the message.
2) Fire your documentation staff. Your online help files for compiler and
linker errors really blows chunks.
For crap sakes, I spent 2 grand for VS.NET, and $100 says the MS response to
this message is "this issue will be addressed in an upcoming release (whidbey)"
-- nice, I'm going to have to plop down another 2 g's for that...