Jump to content
  • Advertisement
Sign in to follow this  
Schluppi

ostream& as param in a DLL

This topic is 4634 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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!