Opened 12 years ago
Closed 10 years ago
#4999 closed Bugs (fixed)
boost-log from SVN doesn't compile on gcc 4.6
Reported by: | Owned by: | Douglas Gregor | |
---|---|---|---|
Milestone: | To Be Determined | Component: | signals |
Version: | Boost 1.45.0 | Severity: | Problem |
Keywords: | Cc: | denis.arnaud_boost@… |
Description
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:
boost_1_45_0/libs/signals/src/named_slot_map.cpp:94
void named_slot_map::disconnect(const stored_group& name) {
group_iterator group = groups.find(name); if (group != groups.end()) {
slot_pair_iterator i = group->second.begin(); while (i != group->second.end()) {
slot_pair_iterator next = i; ++next; i->first.disconnect(); i = next;
} groups.erase(group);
}
}
Gives me the following error:
darwin.compile.c++ bin.v2/libs/signals/build/darwin-4.6.0/debug/link-static/named_slot_map.o
"/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"
In file included from /opt/local/include/gcc46/c++/map:61:0,
from ./boost/signals/detail/named_slot_map.hpp:20, from libs/signals/src/named_slot_map.cpp:12:
/opt/local/include/gcc46/c++/bits/stl_map.h: In member function 'void std::map<_Key, _Tp, _Compare, _Alloc>::erase(std::map<_Key, _Tp, _Compare, _Alloc>::iterator) [with _Key = boost::signals::detail::stored_group, _Tp = std::list<boost::signals::detail::connection_slot_pair>, _Compare = boost::function2<bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group>, _Alloc = std::allocator<std::pair<const boost::signals::detail::stored_group, std::list<boost::signals::detail::connection_slot_pair> > >, std::map<_Key, _Tp, _Compare, _Alloc>::iterator = std::_Rb_tree_iterator<std::pair<const boost::signals::detail::stored_group, std::list<boost::signals::detail::connection_slot_pair> > >]': 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<boost::signals::detail::stored_group, std::list<boost::signals::detail::connection_slot_pair>, boost::function2<bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group> >::iterator&)' 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<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::erase(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator) [with _Key = boost::signals::detail::stored_group, _Val = std::pair<const boost::signals::detail::stored_group, std::list<boost::signals::detail::connection_slot_pair> >, _KeyOfValue = std::_Select1st<std::pair<const boost::signals::detail::stored_group, std::list<boost::signals::detail::connection_slot_pair> > >, _Compare = boost::function2<bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group>, _Alloc = std::allocator<std::pair<const boost::signals::detail::stored_group, std::list<boost::signals::detail::connection_slot_pair> > >, std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree_const_iterator<std::pair<const boost::signals::detail::stored_group, std::list<boost::signals::detail::connection_slot_pair> > >] /opt/local/include/gcc46/c++/bits/stl_tree.h:1490:5: note: std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::erase(const _Key&) [with _Key = boost::signals::detail::stored_group, _Val = std::pair<const boost::signals::detail::stored_group, std::list<boost::signals::detail::connection_slot_pair> >, _KeyOfValue = std::_Select1st<std::pair<const boost::signals::detail::stored_group, std::list<boost::signals::detail::connection_slot_pair> > >, _Compare = boost::function2<bool, boost::signals::detail::stored_group, boost::signals::detail::stored_group>, _Alloc = std::allocator<std::pair<const boost::signals::detail::stored_group, std::list<boost::signals::detail::connection_slot_pair> > >, std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type = long unsigned int]
I also run in to another error:
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...
And can fix this one:
--- /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 @@
#ifndef BOOST_LOG_UTILITY_TYPE_INFO_WRAPPER_HPP_INCLUDED_ #define BOOST_LOG_UTILITY_TYPE_INFO_WRAPPER_HPP_INCLUDED_
+#include <stdlib.h> +
#include <typeinfo> #include <string> #include <boost/log/detail/prologue.hpp>
@@ -51,7 +53,7 @@
struct auto_free {
explicit auto_free(void* p) : p_(p) {}
- ~auto_free() { free(p_); }
+ ~auto_free() { ::free(p_); }
private:
void* p_;
};
Exit 1
gcc-mp-4.6 (GCC) 4.6.0 20101211 (experimental)
Attachments (2)
Change History (10)
comment:1 by , 12 years ago
Component: | Building Boost → signals |
---|---|
Owner: | changed from | to
- The first problem is not related to Boost.Log, I'm reassigning it to Boost.Signals maintainer.
- I've fixed the incorrect include in Boost.Log, thanks.
- Please, don't post several problems in a single ticket.
- 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 SourceForge project. You can ask for support there.
by , 12 years ago
Attachment: | boost-1.46.0-signals-erase.patch added |
---|
This should fix the problem with the ambiguous erase
comment:3 by , 12 years ago
Cc: | added |
---|
comment:4 by , 11 years ago
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.
comment:5 by , 10 years ago
This just bit me when trying to compile with Clang and libc++. Apparently this is still not fixed in HEAD?
comment:6 by , 10 years ago
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.
comment:8 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |