views:

26

answers:

3

We have a linker error when upgrading an SDK.

Looking inside the .lib file we can see the old function definition was:

?SetupMOSSDK@@YAEPBGKPBUMOSGUID@@K@Z

However the new .lib file has a slightly different definition of the same function:

?SetupMOSSDK@@YAEPB_WKPBUMOSGUID@@K@Z

The change is the _W instead of a G.

What I do not know is what this string actually represents. I assume the compiler is indicating its compile time configuration within the string. Am I correct?

A: 

There is probably a way to find out what parameter changed from the .lib definition. However you are going to have to recompile your code to change what you pass anyway so the best way is to look at the header or interface definition in source code and change your source to match it

Mark
+2  A: 

Try using undname.exe in your vc\bin dir. It didn't work for me on your strings but maybe you are using a different version of visual studio - I'm using 2008.

Danra
Indeed, I just tried it and added the ? at the start of the function definition. The definition showed that it was originally expecting unsigned short and now was expecting wchar_t. Changing the compiler Language option "Treat wchar_t as Built-in Type" to Yes fixed my linking. Many thanks
Phil Hannent
A: 

The compiler is indicating the parameters and return type of the function. So the function in the lib file has a different set of parameters to the function definition in the .h file you're using.

Paul Mitchell