Boost C++ Libraries: Ticket #996: boost threads doesn't build on windows with UNICODE https://svn.boost.org/trac10/ticket/996 <p> in mutex.inl: </p> <p> if (HMODULE kernel_module = <a class="missing wiki">GetModuleHandle</a>(TEXT("KERNEL32.DLL"))) </p> <blockquote> <p> g_TryEnterCriticalSection = </p> </blockquote> <p> reinterpret_cast&lt;TryEnterCriticalSection_type&gt;(<a class="missing wiki">GetProcAddress</a>(kernel_module, TEXT("<a class="missing wiki">TryEnterCriticalSection</a>"))); </p> <p> The problem is that <a class="missing wiki">GetProcAddress</a>() on windows only has ascii version and takes lpcstr as the name of the function to lookup, so if you define UNICODE to do windows unicode build, compiler complains that you're trying to pass WCHAR* as char*. </p> <p> A complication here is with wince, which is the opposite and only takes WCHAR* as the name of the function so the correct code should pass "<a class="missing wiki">TryEnterCriticalSection</a>" on non-wince and L"<a class="missing wiki">TryEnterCriticalSection</a>" on wince. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/996 Trac 1.4.3 Thomas Witt Fri, 25 May 2007 18:52:03 GMT cc, severity changed; version, milestone set https://svn.boost.org/trac10/ticket/996#comment:1 https://svn.boost.org/trac10/ticket/996#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">witt@…</span> added </li> <li><strong>version</strong> → <span class="trac-field-new">release 1.34.0</span> </li> <li><strong>severity</strong> <span class="trac-field-old">Problem</span> → <span class="trac-field-new">Showstopper</span> </li> <li><strong>milestone</strong> → <span class="trac-field-new">Boost 1.34.1</span> </li> </ul> Ticket Anthony Williams Tue, 29 May 2007 10:53:36 GMT status changed https://svn.boost.org/trac10/ticket/996#comment:2 https://svn.boost.org/trac10/ticket/996#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Anthony Williams Tue, 29 May 2007 10:54:12 GMT attachment set https://svn.boost.org/trac10/ticket/996 https://svn.boost.org/trac10/ticket/996 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">mutex.inl.patch</span> </li> </ul> Ticket Thomas Witt Tue, 29 May 2007 17:13:25 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/996#comment:3 https://svn.boost.org/trac10/ticket/996#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Patch applied. </p> Ticket