VS2005 Linking problem std::_String_base::_Xran

Hello,
I trying to build my project in VS8 (it was building fine in VS2003).
I get these linking error :

engine.lib(ECMFileHandler.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)

engine.lib(ECMFileHandler.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)

engine.lib(ECMFileHandler.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::ios_base::_Addstd(void)" (?_Addstd@ios_base@std@@QAEXXZ)
I checked to make sure all my projects are compiled in MT debug.

Here are the command line of the linker for my projects:

Dodgeball:

/OUT:"D:\SVN_Dev\build\dodgeball\Debug\DodgeBall.exe" /NOLOGO /LIBPATH:"D:\SVN_Dev\libs\NewtonSDK\sdk\dll" /MANIFEST /MANIFESTFILE:"Debug\DodgeBall.exe.intermediate.manifest" /DEBUG /PDB:"d:\SVN_Dev\build\dodgeball\Debug\DodgeBall.pdb" /ERRORREPORT:PROMPT d3dx9d.lib d3d9.lib comctl32.lib d3dxof.lib dinput.lib libcmtd.lib libcpmtd.lib dinput8.lib dsound.lib dsetup.lib dplayx.lib dxguid.lib dxtrans.lib dxErr9.lib winmm.lib newton.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "..\..\build\engin\debug\engine.lib" "..\..\build\dx9utils\debug\dx9utils.lib" "..\..\build\math\debug\math.lib" "..\..\build\utils\debug\utils.lib"

dx9utils:
/OUT:"D:\SVN_Dev\build\dx9utils\Debug\DX9Utils.dll" /NOLOGO /DLL /MANIFEST /MANIFESTFILE:"D:\SVN_Dev\build\dx9utils\Debug\DX9Utils.dll.intermediate.manifest" /DEBUG /PDB:"d:\SVN_Dev\build\dx9utils\Debug\DX9Utils.pdb" /ERRORREPORT:PROMPT d3dx9d.lib d3d9.lib d3dxof.lib dinput.lib dinput8.lib dsound.lib dsetup.lib dplayx.lib dxguid.lib dxtrans.lib dxErr9.lib winmm.lib libcpmtd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

engine:
/OUT:"D:\SVN_Dev\build\Engin\Debug\Engine.dll" /NOLOGO /LIBPATH:"D:\SVN_Dev\libs\NewtonSDK\sdk\dll" /DLL /MANIFEST /MANIFESTFILE:"D:\SVN_Dev\build\Engin\Debug\Engine.dll.intermediate.manifest" /DEBUG /PDB:"d:\SVN_Dev\build\Engin\Debug\Engine.pdb" /ERRORREPORT:PROMPT d3dx9d.lib d3d9.lib d3dxof.lib dinput.lib dinput8.lib dsound.lib dsetup.lib dplayx.lib dxguid.lib dxtrans.lib dxErr9.lib winmm.lib newton.lib libcpmtd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "..\..\build\dx9utils\debug\dx9utils.lib" "..\..\build\math\debug\math.lib" "..\..\build\utils\debug\utils.lib"

math:
/OUT:"D:\SVN_Dev\build\Math\Debug\Math.dll" /NOLOGO /DLL /MANIFEST /MANIFESTFILE:"D:\SVN_Dev\build\Math\Debug\Math.dll.intermediate.manifest" /DEBUG /PDB:"d:\SVN_Dev\build\math\Debug\Math.pdb" /ERRORREPORT:PROMPT libcpmtd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

utils:
/OUT:"D:\SVN_Dev\build\utils\Debug\Utils.dll" /NOLOGO /DLL /MANIFEST /MANIFESTFILE:"D:\SVN_Dev\build\utils\Debug\Utils.dll.intermediate.manifest" /DEBUG /PDB:"d:\SVN_Dev\build\utils\Debug\Utils.pdb" /ERRORREPORT:PROMPT libcpmtd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\build\dx9utils\Debug\DX9Utils.lib

I have been adding different libs to the configuration and searching on google with no success...
I hope someone can tell me what is going on !

Thanks

[3726 byte] By [luffy] at [2007-12-16]
# 1
Hmm: I think I might know what is going on here. A dump of the symbols in the libcpmtd.lib that ships with Visual C++ 2005 show the following definition for Xran

131 00000000 SECT62 notype () External | ?_Xran@_String_base@std@@SAXXZ (public: static void __cdecl std::_String_base::_Xran(void))

Notice how it is a __cdecl function and the error message you are seeing states that it is a __thiscall function.

Also if I look at the current definition of _String_base (which is in the xstring header file) I see the following:

class _CRTIMP2_PURE _String_base : public _Container_base
{
public
:
_MRTIMP2_NPURE_NCEEPURE
static void
__CLRCALL_PURE_OR_CDECL _Xlen();
_MRTIMP2_NPURE_NCEEPURE static void
__CLRCALL_PURE_OR_CDECL _Xran();
_MRTIMP2_NPURE_NCEEPURE static void
__CLRCALL_PURE_OR_CDECL _Xinvarg();
};

For a native compilation __CLRCALL_PURE_OR_CDECL should map to __cdecl.

If I was you I would take a look at your definition of _String_base and check that the member function declarations use the __CLRCALL_PURE_OR_CDECL macro and if they don't then you might want to make them explicitly __cdecl as I note that you do not appear to be compiling for the CLR.

JonathanCavesMSFT at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ General...
# 2
I had the same problem when convertin Crypto51/523 library from VS2003 to VS2005. I figured out that newly built cryptolib.lib went to different folder and the main app was trying to link to old .lib file. As soon as paths were fixed the issue resolved.
izm_ka at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ General...
# 3
I'm having this same problem. The linker output says __thiscall instead of __cdecl. If the linker is showing __thiscall, but it should be __cdecl, why is the linker doing this? Which library should Xran be found in?
# 4
Did you ever figure this out? I'm encountering the same issue...
pezimadio at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ General...
# 5
I got rid of this problem by just doing a "Rebuild All" of my project.
FabioCecin at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ General...
# 6

Hi,

I have the same problem...I am new to VC++...Here are the errors

dSSTSDKsul.lib(hex.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)

1>dSSTSDKsul.lib(oaep.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)

From your explanation above i see that the function call should be _cdecl instead of _thiscall.But i don't know how to change it...

Pls help me out.

Thanks

Thilak Raj S

Thilak28 at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ General...