Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ATL COM, std::string, Unresolved symbol errors

Status
Not open for further replies.

SteveBrett

Programmer
Apr 24, 2000
107
0
0
MT
Bit of a newbie to com but I have the following questions.

I have the following function:

std::string ExtractSOAPAction(const char* pBuffer)
{
char szSOAPAction[255];
memset(szSOAPAction, 0, 255);

//////////////////////////////////////////////////////////
// Extract SOAP Action from message.

const char* pStartPos = NULL;
const char* pEndPos = NULL;
int iSOAPActionLength = 0;

// Get start position of actual data
pStartPos = pBuffer;
pStartPos = strstr(pStartPos, "<action");
pStartPos = strstr(pStartPos, ">");
pStartPos = strstr(pStartPos, "urn");

// Get end position of actual data
pEndPos = strpbrk(pStartPos, "\r\n<" );

iSOAPActionLength = pEndPos - pStartPos;
strncpy(szSOAPAction, pStartPos, iSOAPActionLength);

return szSOAPAction;
}

which sits in an atl com project.

it is referenced thus:

std::string objSOAPAction = CSSLConnection::ExtractSOAPAction(m_objMessage);

when i try to build the code i get the following error:

CallCreditSSL error LNK2019: unresolved external symbol "private: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall CSSLConnection::ExtractSOAPAction(char const *)" (?ExtractSOAPAction@CSSLConnection@@AAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBD@Z) referenced in function "public: virtual long __stdcall CSSLConnection::SendMsg(unsigned short *,long *)" (?SendMsg@CSSLConnection@@UAGJPAGPAJ@Z)


Any ideas ? 5 hours on google has got me nowhere ;-(
 
Is this a DLL? If it is, create a dummy DLL project and have a look at the headers generated for the include files. It is some combination of dll_import dll_export.

 
from trial and error i seemed to fix it by fully referencing the functions i.e.

std::string SSLConnection::ExtractSOAPAction(const char* pBuffer)
{ ...

 
Yes, from your output, it seems youve defined that function as a member of a class, but you didnt put the CMyClass:: in front of the declaration:

__thiscall CSSLConnection::ExtractSOAPAction(char const *)" etc etc



Skute

&quot;There are 10 types of people in this World, those that understand binary, and those that don't!&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top