Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6320: creation of path from std::string on Windows (VC10) crashes (access error)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-10-11 11:52:08
#6320: creation of path from std::string on Windows (VC10) crashes (access error)
-------------------------------+------------------------
Reporter: aris.basic@⦠| Owner: bemandawes
Type: Bugs | Status: closed
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.51.0 | Severity: Problem
Resolution: fixed | Keywords:
-------------------------------+------------------------
Comment (by anonymous):
If you're using Boost as a static lib in a DLL you have to apply the fix
in the DLLMain
example:
{{{#!cpp
#ifdef WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <Windows.h>
#include <boost/filesystem/path.hpp>
static void init_boost () {
boost::filesystem::path p("dummy");
};
BOOL APIENTRY DllMain( HMODULE /* hModule */,
DWORD ul_reason_for_call,
LPVOID /* lpReserved */)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
init_boost();
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
#endif
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6320#comment:10> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC