I have seen:
- Convert BSTR to CHAR* and CHAR* to BSTR in C
- Problems converting BSTR to char *
- Convert BSTR to char*
using these question I am attempting to convert a BSTR
to a char*
via
#include "comutil.h"
STDMETHODIMP CServer::Initialise(BSTR strCmdFilePath,
VARIANT_BOOL bDiagErr, VARIANT_BOOL bProcErr, BSTR* RESULT)
{
char *p = _com_util::ConvertBSTRToString(strCmdFilePath);
...
}
but I am getting:
Error 1 error LNK2019: unresolved external symbol "char * __stdcall _com_util::ConvertBSTRToString(wchar_t *)" (?ConvertBSTRToString@_com_util@@YGPADPA_W@Z) referenced in function "public: virtual long __stdcall CServer::Initialise(wchar_t *,short,short,wchar_t * *)" (?Initialise@CServer@@UAGJPA_WFFPAPA_W@Z)
Why am I getting this error?