[boost::locale::generator] Calling boost::locale::generator results in an exception in EnterCriticalSection

M L via Boost-users <[email protected]> Wed, 24 May 2023 10:38:38 +0200
Newsgroups gmane.comp.lib.boost.user
Message-ID <CACbOz=mdTcrMJ6Z9n1B9vco7Nn7bwziMA9hvOJNakvqv_V_O8g@mail.gmail.com>
Hello,

calling boost::locale::generator results in an exception in
EnterCriticalSection.
Does anybody have a hint to the cause of this problem?
Every small clue is welcome. What could be a possible workaround?
What is usually the reason for an exception in EnterCriticalSection?


Code snippet:
boost::locale::generator generator;
generator.add_messages_path("...");
generator.add_messages_domain("..");
std::string lngCode = "en";
std::locale = generator(lngCode + ".WINDOWS-1252"); // this line crashes

->
0x0000005
EnterCriticalSection
Boost Version: (boost_1_60_0)
Visual Studio 2013


Some more hints:
- it seems that there is a problem reading the translation file, which
works fine in other applications.
- there are no threads in the code
-  the problem is project dependent. Same code works in a different project.
- the problem only appears if a specific header is included, but
nothing in this header is ever executed before the crash. Removing the
header/cpp removes the problem.
- some C code is present in the code
-  the problem even appears when moving the snipped in main.

Thanks for help.