Boost C++ Libraries: Ticket #8832: Boost and /clr code https://svn.boost.org/trac10/ticket/8832 <p> When using boost in an application which uses threads it gives the fault message: </p> <pre class="wiki">1&gt;c:\program files (x86)\boost\boost_1_47\boost\thread\win32\thread_primitives.hpp(314): error C2472: 'boost::detail::win32::interlocked_bit_test_and_set' cannot be generated in managed code: 'Found an intrinsic not supported in managed code'; compile with /clr to generate a mixed image 1&gt;c:\program files (x86)\boost\boost_1_47\boost\thread\win32\basic_timed_mutex.hpp(160): error C2472: 'boost::detail::basic_timed_mutex::unlock' cannot be generated in managed code: 'Found an intrinsic not supported in managed code'; compile with /clr to generate a mixed image </pre><p> Found on the internet: Boost.thread uses some thread local storage calls that don't work if you directly link them with CLR code. In VS2008 the link would succeed but you'd crash on startup -- I suspect this is a symptom of the same problem, VS2010-style. </p> <p> On stackoverflow I found the following workaround: It is necessary to build boost.thread as a DLL instead of linking it statically, and maybe it'll link for you that way... </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8832 Trac 1.4.3 viboes Sun, 04 Aug 2013 08:08:03 GMT owner, status, component changed https://svn.boost.org/trac10/ticket/8832#comment:1 https://svn.boost.org/trac10/ticket/8832#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>component</strong> <span class="trac-field-old">threads</span> → <span class="trac-field-new">thread</span> </li> </ul> <p> What do you expect from this ticket? </p> Ticket anonymous Wed, 07 Aug 2013 05:50:49 GMT <link>https://svn.boost.org/trac10/ticket/8832#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8832#comment:2</guid> <description> <p> Maybe there is a way to avoid this, so when compiling a program in managed code, there isn't any intrinsic which is not supported in managed code. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 09 Aug 2013 06:35:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8832#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8832#comment:3</guid> <description> <p> Could you try to compile Boost.Thread with /clr as suggested </p> <p> "compile with /clr to generate a mixed image"? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 21 Aug 2013 09:45:06 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8832#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8832#comment:4</guid> <description> <p> I haven)t tried it, because I did not use the library which gives this problem, because my program needs to work. I have decided to use something else, but I will try when my program is done, to compile it as suggested. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 22 Aug 2013 22:05:02 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8832#comment:5 https://svn.boost.org/trac10/ticket/8832#comment:5 <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">wontfix</span> </li> </ul> Ticket