Monday, May 21, 2012

Unresolved typeref token

I have had a pair of link warnings hanging around for a while:

warning LNK4248: unresolved typeref token (0100001A) for 'xercesc_3_1.XMLGrammarPool'; image may not run

and

 warning LNK4248: unresolved typeref token (0100001E) for 'SNDFILE_tag'; image may not run

Since they are not terminal... they got less attention.
I have tracked down some information on the subject. 

http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/0730e965-7299-44ca-8a95-59e2eb23d153

There are two good solutions posed in the forum.

1) Include a supression command on the linker command line

Under Configuration Properties -> Linker -> Command Line -> Additional options, add "/ignore:4248" (without the quotes).

2) Include an empty definition for the incomplete types.

I.e

struct WeirdTypeNameHere {};


I've chosen this option becasue the types are defined in third party libraries ( xerces and libsndfile ) and I don't really want to hide the problem on the linker command line.  Its just too easy to get lost in all the property page mess that I have spent the past week untangling.


No comments:

Post a Comment