Boost C++ Libraries: Ticket #3378: interlocked.hpp won't compile https://svn.boost.org/trac10/ticket/3378 <p> Suddenly and for no discernible reason, merely including any (I assume) boost header file produces the compiler errors below. I was including only boost/math/distributions/binomial.hpp when the problem arose. I tested #include&lt;boost/signal.hpp&gt; alone as well, producing the same errors. Nothing in my own code changed (backup copies that compiled when they were saved won't compile now). I tried rerunning the boostpro installer, but it had no effect. I'm using Visual Studio 2008. </p> <p> 1&gt;C:\Program Files\boost\boost_1_39\boost/detail/interlocked.hpp(57) : error C2373: '_InterlockedIncrement' : redefinition; different type modifiers 1&gt; c:\Program Files\Microsoft Visual Studio 9.0\VC\include\memory(993) : see declaration of '_InterlockedIncrement' 1&gt;C:\Program Files\boost\boost_1_39\boost/detail/interlocked.hpp(58) : error C2373: '_InterlockedDecrement' : redefinition; different type modifiers 1&gt; c:\Program Files\Microsoft Visual Studio 9.0\VC\include\memory(994) : see declaration of '_InterlockedDecrement' 1&gt;C:\Program Files\boost\boost_1_39\boost/detail/interlocked.hpp(59) : error C2373: '_InterlockedCompareExchange' : redefinition; different type modifiers 1&gt; c:\Program Files\Microsoft Visual Studio 9.0\VC\include\memory(995) : see declaration of '_InterlockedCompareExchange' 1&gt;C:\Program Files\boost\boost_1_39\boost/smart_ptr/detail/sp_counted_base_w32.hpp(73) : error C3861: '_InterlockedIncrement': identifier not found 1&gt;C:\Program Files\boost\boost_1_39\boost/smart_ptr/detail/sp_counted_base_w32.hpp(92) : error C2446: '==' : no conversion from 'long' to 'long (<span class="underline">clrcall *)(volatile long *,long,long)' 1&gt;C:\Program Files\boost\boost_1_39\boost/smart_ptr/detail/sp_counted_base_w32.hpp(92) : error C2040: '==' : 'long (</span>clrcall *)(volatile long *,long,long)' differs in levels of indirection from 'long' 1&gt;C:\Program Files\boost\boost_1_39\boost/smart_ptr/detail/sp_counted_base_w32.hpp(92) : error C3861: '_InterlockedCompareExchange': identifier not found 1&gt;C:\Program Files\boost\boost_1_39\boost/smart_ptr/detail/sp_counted_base_w32.hpp(100) : error C3861: '_InterlockedDecrement': identifier not found 1&gt;C:\Program Files\boost\boost_1_39\boost/smart_ptr/detail/sp_counted_base_w32.hpp(109) : error C3861: '_InterlockedIncrement': identifier not found 1&gt;C:\Program Files\boost\boost_1_39\boost/smart_ptr/detail/sp_counted_base_w32.hpp(114) : error C3861: '_InterlockedDecrement': identifier not found </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3378 Trac 1.4.3 John Maddock Tue, 01 Sep 2009 12:05:28 GMT owner changed https://svn.boost.org/trac10/ticket/3378#comment:1 https://svn.boost.org/trac10/ticket/3378#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">John Maddock</span> to <span class="trac-author">Peter Dimov</span> </li> </ul> <p> No idea, _something_ must have changed. I can't find any similar reports anywhere on the mailing list or in the Trac, so I'm reassigning to interlocked.hpp's author. </p> Ticket anonymous Tue, 01 Sep 2009 13:19:16 GMT <link>https://svn.boost.org/trac10/ticket/3378#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3378#comment:2</guid> <description> <p> I still have no idea what changed, but adding #define BOOST_USE_WINDOWS_H solves the problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Tue, 01 Sep 2009 17:46:33 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/3378#comment:3 https://svn.boost.org/trac10/ticket/3378#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Are you compiling with /clr? The only difference I see between the declarations in interlocked.hpp and &lt;memory&gt; is that &lt;memory&gt; uses <span class="underline">clrcall when _M_CEE_PURE is defined, </span>cdecl if not (see yvals.h:53). </p> Ticket Peter Dimov Thu, 26 Nov 2009 21:40:52 GMT <link>https://svn.boost.org/trac10/ticket/3378#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3378#comment:4</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/57958" title="Fix interlocked.hpp to compile under /clr:pure. Refs #3378.">[57958]</a>) Fix interlocked.hpp to compile under /clr:pure. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3378" title="#3378: Bugs: interlocked.hpp won't compile (closed: fixed)">#3378</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Mon, 30 Nov 2009 20:38:33 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3378#comment:5 https://svn.boost.org/trac10/ticket/3378#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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/58069" title="Merge [57958] to release. Fixes #3378.">[58069]</a>) Merge <a class="changeset" href="https://svn.boost.org/trac10/changeset/57958" title="Fix interlocked.hpp to compile under /clr:pure. Refs #3378.">[57958]</a> to release. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3378" title="#3378: Bugs: interlocked.hpp won't compile (closed: fixed)">#3378</a>. </p> Ticket