Boost C++ Libraries: Ticket #4987: pch.hpp.gch build fails with boost::swap' has not been declared in boost::optional https://svn.boost.org/trac10/ticket/4987 <p> Starting on 13th of december, nightly tests for some software I maintain started to fail with boost release because boost release does not build anymore: </p> <p> The full log is here </p> <p> <a class="ext-link" href="http://www.kr.tuwien.ac.at/pg/ps/dlvhex/nightly/build_withboost_2010-12-15_06:00.txt"><span class="icon">​</span>http://www.kr.tuwien.ac.at/pg/ps/dlvhex/nightly/build_withboost_2010-12-15_06:00.txt</a> </p> <p> The error is </p> <p> ...patience... ...found 6165 targets... ...updating 667 targets... common.mkdir stage common.mkdir stage/lib common.mkdir bin.v2/libs/iostreams common.mkdir bin.v2/libs/iostreams/build common.mkdir bin.v2/libs/iostreams/build/gcc-4.2.1 common.mkdir bin.v2/libs/iostreams/build/gcc-4.2.1/release common.mkdir bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi/file_descriptor.o gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi/mapped_file.o gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi/zlib.o gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi/gzip.o gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi/bzip2.o gcc.link.dll bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi/libboost_iostreams.so.1.46.0 common.copy stage/lib/libboost_iostreams.so.1.46.0 ln-UNIX stage/lib/libboost_iostreams.so common.mkdir bin.v2/libs/math/build common.mkdir bin.v2/libs/math/build/gcc-4.2.1 common.mkdir bin.v2/libs/math/build/gcc-4.2.1/release common.mkdir bin.v2/libs/math/build/gcc-4.2.1/release/threading-multi common.mkdir bin.v2/libs/math/build/gcc-4.2.1/release/threading-multi/.. common.mkdir bin.v2/libs/math/build/gcc-4.2.1/release/threading-multi/../src common.mkdir bin.v2/libs/math/build/gcc-4.2.1/release/threading-multi/../src/tr1 gcc.compile.c++.pch bin.v2/libs/math/build/gcc-4.2.1/release/threading-multi/../src/tr1/pch.hpp.gch In file included from ./boost/optional.hpp:15, </p> <blockquote> <p> from ./boost/format/internals.hpp:20, from ./boost/format.hpp:38, from ./boost/math/policies/error_handling.hpp:30, from ./boost/math/special_functions/acosh.hpp:21, from ./boost/math/special_functions.hpp:15, from libs/math/build/../src/tr1/pch.hpp:9: </p> </blockquote> <p> ./boost/optional/optional.hpp: In member function 'void boost::optional&lt;T&gt;::swap(boost::optional&lt;T&gt;&amp;)': ./boost/optional/optional.hpp:618: error: 'boost::swap' has not been declared </p> <blockquote> <p> "g++" -x c++-header -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_BUILD_PCH_ENABLED -DBOOST_MATH_TR1_DYN_LINK=1 -DNDEBUG -I"." -I"libs/math/src/tr1" -c -o "bin.v2/libs/math/build/gcc-4.2.1/release/threading-multi/../src/tr1/pch.hpp.gch" "libs/math/build/../src/tr1/pch.hpp" </p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4987 Trac 1.4.3 Peter Schüller <schueller.p@…> Fri, 17 Dec 2010 12:37:30 GMT <link>https://svn.boost.org/trac10/ticket/4987#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4987#comment:1</guid> <description> <p> now also reproduced on different machine: </p> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/67280" title="Spirit: documentation update ">[67280]</a> release branch fails to build with </p> <pre class="wiki">./bootstrap.sh ./bjam </pre><p> now more succinct and better formatted error message: </p> <pre class="wiki">gcc.compile.c++.pch bin.v2/libs/math/build/gcc-4.3/release/threading-multi/../src/tr1/pch.hpp.gch In file included from ./boost/optional.hpp:15, from ./boost/format/internals.hpp:20, from ./boost/format.hpp:38, from ./boost/math/policies/error_handling.hpp:30, from ./boost/math/special_functions/acosh.hpp:21, from ./boost/math/special_functions.hpp:15, from libs/math/build/../src/tr1/pch.hpp:9: ./boost/optional/optional.hpp: In member function ‘void boost::optional&lt;T&gt;::swap(boost::optional&lt;T&gt;&amp;)’: ./boost/optional/optional.hpp:618: error: ‘boost::swap’ has not been declared "g++" -x c++-header -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_BUILD_PCH_ENABLED -DBOOST_MATH_TR1_DYN_LINK=1 -DNDEBUG -I"." -I"libs/math/src/tr1" -c -o "bin.v2/libs/math/build/gcc-4.3/release/threading-multi/../src/tr1/pch.hpp.gch" "libs/math/build/../src/tr1/pch.hpp" ...failed gcc.compile.c++.pch bin.v2/libs/math/build/gcc-4.3/release/threading-multi/../src/tr1/pch.hpp.gch... </pre> </description> <category>Ticket</category> </item> <item> <author>Peter Schüller <schueller.p@…></author> <pubDate>Fri, 17 Dec 2010 12:40:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4987#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4987#comment:2</guid> <description> <p> possibly introduced by <a class="changeset" href="https://svn.boost.org/trac10/changeset/67183" title="Merged changes from trunk. Fixes #3395. Also updates swap behavior: if ...">[67183]</a>? </p> <pre class="wiki">r67183 | andysem | 2010-12-12 12:34:12 +0100 (Sun, 12 Dec 2010) | 1 line Changed paths: M /branches/release/boost/optional/optional.hpp M /branches/release/boost/optional/optional_io.hpp M /branches/release/libs/optional/test/optional_test.cpp M /branches/release/libs/optional/test/optional_test_io.cpp Merged changes from trunk. Fixes #3395. Also updates swap behavior: if default constructor has no-throw guarantee, swap will use it to pr ovide no-throw guarantee itself. operator&gt;&gt; behavior changed slightly so that the stream is not accessed when unrecognized character sequ ence is detected. The stream is marked with failbit in such a case. </pre> </description> <category>Ticket</category> </item> <item> <author>Peter Schüller <schueller.p@…></author> <pubDate>Fri, 17 Dec 2010 12:41:25 GMT</pubDate> <title>owner set https://svn.boost.org/trac10/ticket/4987#comment:3 https://svn.boost.org/trac10/ticket/4987#comment:3 <ul> <li><strong>owner</strong> set to <span class="trac-author">Andrey Semashev</span> </li> </ul> <p> reassigning to andysem on a hunch </p> Ticket Andrey Semashev Fri, 17 Dec 2010 21:13:01 GMT <link>https://svn.boost.org/trac10/ticket/4987#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4987#comment:4</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/67288" title="Refs #4987. Added forward declaration of namespace-scope swap for ...">[67288]</a>) Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4987" title="#4987: Bugs: pch.hpp.gch build fails with boost::swap' has not been declared in ... (closed: fixed)">#4987</a>. Added forward declaration of namespace-scope swap for boost::optional, this should fix GCC compilation errors. Also swap implementation now uses Boost.Utility.Swap to make use of the workarounds for some broken compilers. If it breaks for your compiler, let me know in the mentioned ticket. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Fri, 17 Dec 2010 21:18:06 GMT</pubDate> <title>status, component changed https://svn.boost.org/trac10/ticket/4987#comment:5 https://svn.boost.org/trac10/ticket/4987#comment:5 <ul> <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">Building Boost</span> → <span class="trac-field-new">optional</span> </li> </ul> <p> Could you please verify that the trunk version works for you now? </p> Ticket Peter Schüller <schueller.p@…> Sat, 18 Dec 2010 12:09:48 GMT <link>https://svn.boost.org/trac10/ticket/4987#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4987#comment:6</guid> <description> <p> trunk <a class="changeset" href="https://svn.boost.org/trac10/changeset/67294" title="Re-added the call to free() to utree's dtor, added a call to ...">[67294]</a> builds nicely, but trunk built nicely before! </p> <p> after doing a </p> <pre class="wiki">svn merge http://svn.boost.org/svn/boost/trunk -c 67288 </pre><p> the release branch now also works for me. </p> <p> Please merge your fix into the release branch, then everything should be fixed. </p> <p> Thanks a lot! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Sat, 18 Dec 2010 21:29:42 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4987#comment:7 https://svn.boost.org/trac10/ticket/4987#comment:7 <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/67307" title="Merged changes from trunk: add namespace scope swap forward ...">[67307]</a>) Merged changes from trunk: add namespace scope swap forward declaration to fix member swap copmilation. Swap implementation now uses Boost.Utility.Swap. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4987" title="#4987: Bugs: pch.hpp.gch build fails with boost::swap' has not been declared in ... (closed: fixed)">#4987</a>. </p> Ticket