Boost C++ Libraries: Ticket #4999: boost-log from SVN doesn't compile on gcc 4.6 https://svn.boost.org/trac10/ticket/4999 <p> I'm attempting to use boost-log from SVN with boost 1.45.0 on Darwin w/ gcc 4.6. When I attempt to compile it, the following code: </p> <p> <em> boost_1_45_0/libs/signals/src/named_slot_map.cpp:94 </em></p> <p> void named_slot_map::disconnect(const stored_group&amp; name) { </p> <blockquote> <p> group_iterator group = groups.find(name); if (group != groups.end()) { </p> <blockquote> <p> slot_pair_iterator i = group-&gt;second.begin(); while (i != group-&gt;second.end()) { </p> <blockquote> <p> slot_pair_iterator next = i; ++next; i-&gt;first.disconnect(); i = next; </p> </blockquote> <p> } groups.erase(group); </p> </blockquote> <p> } </p> </blockquote> <p> } </p> <p> Gives me the following error: </p> <p> darwin.compile.c++ bin.v2/libs/signals/build/darwin-4.6.0/debug/link-static/named_slot_map.o </p> <blockquote> <p> "/opt/local/bin/g++-mp-4.6" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -gdwarf-2 -DBOOST_ALL_NO_LIB=1 -DBOOST_SIGNALS_NO_LIB=1 -I"." -c -o "bin.v2/libs/signals/build/darwin-4.6.0/debug/link-static/named_slot_map.o" "libs/signals/src/named_slot_map.cpp" </p> </blockquote> <p> In file included from /opt/local/include/gcc46/c++/map:61:0, </p> <blockquote> <p> from ./boost/signals/detail/named_slot_map.hpp:20, from libs/signals/src/named_slot_map.cpp:12: </p> </blockquote> <p> /opt/local/include/gcc46/c++/bits/stl_map.h: In member function 'void std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::erase(std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::iterator) [with _Key = boost::signals::detail::stored_group, _Tp = std::list&lt;boost::signals::detail::connection_slot_pair&gt;, _Compare = boost::function2&lt;bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group&gt;, _Alloc = std::allocator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;, std::map&lt;_Key, _Tp, _Compare, _Alloc&gt;::iterator = std::_Rb_tree_iterator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;]': libs/signals/src/named_slot_map.cpp:105:23: instantiated from here /opt/local/include/gcc46/c++/bits/stl_map.h:626:9: error: call of overloaded 'erase(std::map&lt;boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt;, boost::function2&lt;bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group&gt; &gt;::iterator&amp;)' is ambiguous /opt/local/include/gcc46/c++/bits/stl_map.h:626:9: note: candidates are: /opt/local/include/gcc46/c++/bits/stl_tree.h:763:7: note: void std::_Rb_tree&lt;_Key, _Val, _KeyOfValue, _Compare, _Alloc&gt;::erase(std::_Rb_tree&lt;_Key, _Val, _KeyOfValue, _Compare, _Alloc&gt;::const_iterator) [with _Key = boost::signals::detail::stored_group, _Val = std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt;, _KeyOfValue = std::_Select1st&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;, _Compare = boost::function2&lt;bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group&gt;, _Alloc = std::allocator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;, std::_Rb_tree&lt;_Key, _Val, _KeyOfValue, _Compare, _Alloc&gt;::const_iterator = std::_Rb_tree_const_iterator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;] /opt/local/include/gcc46/c++/bits/stl_tree.h:1490:5: note: std::_Rb_tree&lt;_Key, _Val, _KeyOfValue, _Compare, _Alloc&gt;::size_type std::_Rb_tree&lt;_Key, _Val, _KeyOfValue, _Compare, _Alloc&gt;::erase(const _Key&amp;) [with _Key = boost::signals::detail::stored_group, _Val = std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt;, _KeyOfValue = std::_Select1st&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;, _Compare = boost::function2&lt;bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group&gt;, _Alloc = std::allocator&lt;std::pair&lt;const boost::signals::detail::stored_group, std::list&lt;boost::signals::detail::connection_slot_pair&gt; &gt; &gt;, std::_Rb_tree&lt;_Key, _Val, _KeyOfValue, _Compare, _Alloc&gt;::size_type = long unsigned int] </p> <p> I also run in to another error: </p> <p> In file included from libs/log/src/global_logger_storage.cpp:22:0: ./boost/log/utility/type_info_wrapper.hpp: In destructor 'boost::log_st::type_info_wrapper::auto_free::~auto_free()': ./boost/log/utility/type_info_wrapper.hpp:54:31: error: 'free' was not declared in this scope 0.000009 sec system; 0.000043 sec user ...failed updating 1 target... </p> <p> And can fix this one: </p> <p> --- /tmp/type_info_wrapper.hpp 2010-12-18 08:21:03.000000000 -0800 +++ obj/contrib-Darwin-i386/boost_1_45_0/boost/log/utility/type_info_wrapper.hpp 2010-12-18 08:21:18.000000000 -0800 @@ -13,6 +13,8 @@ </p> <blockquote> <p> #ifndef BOOST_LOG_UTILITY_TYPE_INFO_WRAPPER_HPP_INCLUDED_ #define BOOST_LOG_UTILITY_TYPE_INFO_WRAPPER_HPP_INCLUDED_ </p> </blockquote> <p> +#include &lt;stdlib.h&gt; + </p> <blockquote> <p> #include &lt;typeinfo&gt; #include &lt;string&gt; #include &lt;boost/log/detail/prologue.hpp&gt; </p> </blockquote> <p> @@ -51,7 +53,7 @@ </p> <blockquote> <p> struct auto_free { </p> <blockquote> <p> explicit auto_free(void* p) : p_(p) {} </p> </blockquote> </blockquote> <ul><li> ~auto_free() { free(p_); } </li></ul><p> + ~auto_free() { ::free(p_); } </p> <blockquote> <p> private: </p> <blockquote> <p> void* p_; </p> </blockquote> <p> }; </p> </blockquote> <p> Exit 1 </p> <p> gcc-mp-4.6 (GCC) 4.6.0 20101211 (experimental) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4999 Trac 1.4.3 Andrey Semashev Sat, 18 Dec 2010 19:06:12 GMT owner, component changed https://svn.boost.org/trac10/ticket/4999#comment:1 https://svn.boost.org/trac10/ticket/4999#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Andrey Semashev</span> to <span class="trac-author">Douglas Gregor</span> </li> <li><strong>component</strong> <span class="trac-field-old">Building Boost</span> → <span class="trac-field-new">signals</span> </li> </ul> <ol><li>The first problem is not related to Boost.Log, I'm reassigning it to Boost.Signals maintainer. </li><li>I've fixed the incorrect include in Boost.Log, thanks. </li><li>Please, don't post several problems in a single ticket. </li><li>Please, don't post Boost.Log problems to Boost Trac yet. This library is not merged into the official distribution and is maintained as a <a class="missing wiki">SourceForge</a> project. You can ask for support there. </li></ol> Ticket pmachata@… Thu, 03 Feb 2011 20:21:12 GMT attachment set https://svn.boost.org/trac10/ticket/4999 https://svn.boost.org/trac10/ticket/4999 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-1.46.0-signals-erase.patch</span> </li> </ul> <p> This should fix the problem with the ambiguous erase </p> Ticket Steven Watanabe Fri, 11 Feb 2011 04:09:32 GMT <link>https://svn.boost.org/trac10/ticket/4999#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4999#comment:2</guid> <description> <p> That patch will break C++03. </p> </description> <category>Ticket</category> </item> <item> <author>Denis Arnaud <denis.arnaud_boost@…></author> <pubDate>Thu, 24 Feb 2011 22:47:18 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/4999#comment:3 https://svn.boost.org/trac10/ticket/4999#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">denis.arnaud_boost@…</span> added </li> </ul> Ticket Justin SB <justin@…> Mon, 08 Aug 2011 22:17:39 GMT attachment set https://svn.boost.org/trac10/ticket/4999 https://svn.boost.org/trac10/ticket/4999 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fix4999.patch</span> </li> </ul> <p> Patch that should work with C++03 and C++0x </p> Ticket Justin SB <justin@…> Mon, 08 Aug 2011 22:18:14 GMT <link>https://svn.boost.org/trac10/ticket/4999#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4999#comment:4</guid> <description> <p> This problem is still present with gcc 4.6 and --std=c++0x; I've attached a patch which is the same as the above patch, but using the "old" cast-syntax that is compatible with --std=c++03. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>phst</dc:creator> <pubDate>Wed, 11 Jul 2012 16:32:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4999#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4999#comment:5</guid> <description> <p> This just bit me when trying to compile with Clang and libc++. Apparently this is still not fixed in HEAD? </p> </description> <category>Ticket</category> </item> <item> <author>andrew.c.morrow@…</author> <pubDate>Tue, 17 Jul 2012 07:41:26 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4999#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4999#comment:6</guid> <description> <p> I am also encountering this issue when using XCode 4.5 DP2 clang++ to build boost 1.50.0 in C++11 mode. Specifically, it prevents the signals library from building. It would be nice to see this resolved for boost 1.51. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Tue, 17 Jul 2012 16:27:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4999#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4999#comment:7</guid> <description> <p> Applied patch in <a class="changeset" href="https://svn.boost.org/trac10/changeset/79575" title="Apply patch for #4999">[79575]</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Mon, 23 Jul 2012 23:23:11 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4999#comment:8 https://svn.boost.org/trac10/ticket/4999#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">new</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/79709" title="Merge changes from [79575] to Release; fixes #4999">[79709]</a>) Merge changes from <a class="changeset" href="https://svn.boost.org/trac10/changeset/79575" title="Apply patch for #4999">[79575]</a> to Release; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4999" title="#4999: Bugs: boost-log from SVN doesn't compile on gcc 4.6 (closed: fixed)">#4999</a> </p> Ticket