• Advertisement
Sign in to follow this  

ostream& as param in a DLL

This topic is 4336 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I've written a DLL, that exports a function with two parameters, one of those is a reference to an ostream. With this reference I'm going to write some data either to std::cout or to an std::ofstream. The function's header is shown below:
void CPUInfSummary(const CPU_INFO* pInfo, std::ostream& ofOut)
{
  ....
}

Calling this function in the client project, neither the compiler nor the linker throws any errors. But when I run the program, a runtime error occurs. Debugging the project showed, that the error occurs, when the system calls the following function, when trying to a mutex
void _Mtxlock(_Rmtx *_Mtx)
	{	/* lock mutex */
	EnterCriticalSection(_Mtx);
	}

Any ideas. Thanks

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Check if there's a special stl version for passing stl object into dlls. VC for example needs a special one.

Share this post


Link to post
Share on other sites
I've got VC. Can you explain me, how to check, if there's a special stl version. Thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement