Click to See Complete Forum and Search --> : STL string class and DLLs


hudara
March 13th, 2003, 07:36 AM
Hi,

Im using Visual Studio 6 (SP-5).
Im trying to do soming very simple using "string" class of the STL.

I'll try to explain it as clear as possible:


1. I have a DLL which exports the function: string GetName();

std::string DLL_EXPIMP GetName()
{
return std::string("My Name");
}


2. I have an application which uses this function
int main(int argc, char* argv[])
{
std::string Temp = GetName();
printf("*** %s ***\n", Temp.c_str());
return 0;
}

The problem is that the application crashes on exit - BUT ONLY ON DEBUG MODE.

Does anybody knows why it is crashing?
Is this beacuse I don't have the latest version of the STL?
How can I know my STL version?

Thank you very much for your help
Guy Hudara

PaulWendt
March 13th, 2003, 07:53 AM
Usually it's because the DLL and EXE are linking with different
versions of the C-Runtime. You need to go into the Project
Settings dialog to fix this. I usually wind up using Multi-threaded
DLL, but I've used others too.

--Paul