I'm trying to use some lib and dll in my Visual C++ (2015, OS - Windows8x64) MFC Win32 project. This lib is old, from 2005. And in my project I recieve unresolved external symbol errors on some dll's functions calling. So I made a little dumpbin on the referenced dll and it turned out that the mangle names do not match. For example these functions. In *.h file:
1.
class AFX_EXT_CLASS CDcmPatientModule : public CDcmModule
{
public:
DECLARE_SERIAL( CDcmPatientModule );
public:
CString& PatientName();
......
}
and
2.
class AFX_EXT_CLASS CDcmIOD : public CObject
{
friend CDcmModule;
public:
DECLARE_SERIAL( CDcmIOD );
void Export( const CString& pathname );
.....
};
1. Mangle name in project
?PatientName@CDcmPatientModule@@QAEAAV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@XZ
Mangle name in dll
?PatientName@CDcmPatientIdentificationModule@@QAEAAVCString@@XZ
demangle name in project (undname command) is:
public: class ATL:CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT > > & __thiscall CDcmPatientIdentificatioModule::PatientName(void)
demangle name in dll is:
public: class CString & __thiscall CDcmPatientIdentificatioModule::PatientName(void)
2. Mangle name in project
?Export@CDcmIOD@@QAEXABV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z
Mangle name in dll
?Export@CDcmAttributeSet@@QAEXABVCString@@@Z
demangle name in project
public void __thiscall CDcmIOD::Export(class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char>>>const &)
And demangle name in DLL
public: void __thiscall CDcmAttributeSet::Export(class CString const &)
So as you can see the difference is between "CString" How to make these names matched??
Added #define USE_ADS_SHARED_LIB - nothing is changed Adding __stdcall in function's declaration also didn't help.