-1

How do I to fix this error, please?

Error:

LNK2001: unresolved external symbol "public: virtual long __stdcall CTProcessus::Init(class ATL::CStringT > >,wchar_t *,wchar_t *,wchar_t *)"

Code:

STDMETHODIMP CTProcessus::Init(BSTR bstrConnectionString, BSTR nomPosteResponsable, BSTR domaine, BSTR DNS)
{
    m_csConnectionString = (LPCTSTR)bstrConnectionString;
    m_bstrNomPosteResponsable = nomPosteResponsable;
    m_bstrDomaine = domaine;
    m_bstrDNS = DNS;

    m_varNomPosteResponsable = (_variant_t)m_bstrNomPosteResponsable;
    m_varDomaine = (_variant_t)m_bstrDomaine;
    m_varDNS = (_variant_t)m_bstrDNS;

    return S_OK;
}

Thanks a lot!

user3477233
  • 37
  • 1
  • 5
  • 1
    Did you copy-paste the error message correctly? There seem to be some mismatched `>`s in there. I don't know much about COM, but it seems the function the linker is complaining about is not the one you posted. The former takes a `CString` followed by 3 `wchar_t *` arguments, whereas the function you've posted takes 4 `BSTR` arguments. – Praetorian Apr 07 '14 at 16:49

1 Answers1

0

Since your code is able to compile successfully this means that you have the correct function signature in the header file. But your .cpp file does not have this function defined. There is also a chance that your .cpp file isn't getting compiled at all and .obj files are not getting generated.