Boost C++ Libraries: Ticket #6647: BGL strong_components do not compile on MSVC 8 https://svn.boost.org/trac10/ticket/6647 <p> Since boost 1.49.0 the following code does not compile anymore on MSVC 8. </p> <pre class="wiki">#include &lt;boost/config.hpp&gt; #include &lt;vector&gt; #include &lt;boost/graph/strong_components.hpp&gt; #include &lt;boost/graph/adjacency_list.hpp&gt; int main(int, char*[]) { using namespace boost; adjacency_list&lt;&gt; G; std::vector&lt;int&gt; component(num_vertices(G)); int num = strong_components(G, &amp;component[0]); return 0; } </pre><p> I get the following error: </p> <pre class="wiki">c:\boost_1_49_0\boost\graph\strong_components.hpp(60) : error C2784: 'E boost::detail::get(boost::detail::underlying_edge_desc_map_type&lt;E&gt;,const boost::detail::reverse_graph_edge_descriptor&lt;EdgeDesc&gt; &amp;)' : could not deduce template argument for 'boost::detail::underlying_edge_desc_map_type&lt;E&gt;' from 'int *' 1&gt; c:\boost_1_49_0\boost\graph\reverse_graph.hpp(437) : see declaration of 'boost::detail::get' 1&gt; c:\boost_1_49_0\boost\graph\depth_first_search.hpp(43) : see reference to function template instantiation 'void boost::detail::tarjan_scc_visitor&lt;ComponentMap,RootMap,DiscoverTime,Stack&gt;::finish_vertex&lt;Graph&gt;(unsigned int,const Graph &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; ComponentMap=int *, 1&gt; RootMap=boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;, 1&gt; DiscoverTime=boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;, 1&gt; Stack=std::stack&lt;Vertex&gt;, 1&gt; Graph=boost::adjacency_list&lt;&gt; 1&gt; ] 1&gt; c:\boost_1_49_0\boost\graph\depth_first_search.hpp(34) : while compiling class template member function 'void boost::DFSVisitorConcept&lt;Visitor,Graph&gt;::constraints(void)' 1&gt; with 1&gt; [ 1&gt; Visitor=boost::detail::tarjan_scc_visitor&lt;int *,boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;,boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;,std::stack&lt;Vertex&gt;&gt;, 1&gt; Graph=boost::adjacency_list&lt;&gt; 1&gt; ] 1&gt; c:\boost_1_49_0\boost\concept\detail\has_constraints.hpp(42) : see reference to class template instantiation 'boost::DFSVisitorConcept&lt;Visitor,Graph&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Visitor=boost::detail::tarjan_scc_visitor&lt;int *,boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;,boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;,std::stack&lt;Vertex&gt;&gt;, 1&gt; Graph=boost::adjacency_list&lt;&gt; 1&gt; ] 1&gt; c:\boost_1_49_0\boost\concept\detail\msvc.hpp(53) : see reference to class template instantiation 'boost::concepts::not_satisfied&lt;Model&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Model=boost::DFSVisitorConcept&lt;boost::detail::tarjan_scc_visitor&lt;int *,boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;,boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;,std::stack&lt;Vertex&gt;&gt;,boost::adjacency_list&lt;&gt;&gt; 1&gt; ] 1&gt; c:\boost_1_49_0\boost\graph\depth_first_search.hpp(191) : see reference to class template instantiation 'boost::concepts::require&lt;Model&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Model=boost::DFSVisitorConcept&lt;boost::detail::tarjan_scc_visitor&lt;int *,boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;,boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;,std::stack&lt;Vertex&gt;&gt;,boost::adjacency_list&lt;&gt;&gt; 1&gt; ] 1&gt; c:\boost_1_49_0\boost\graph\depth_first_search.hpp(303) : see reference to function template instantiation 'void boost::depth_first_search&lt;VertexListGraph,const Arg,boost::shared_array_property_map&lt;T,IndexMap&gt;&gt;(const VertexListGraph &amp;,DFSVisitor,ColorMap,unsigned int)' being compiled 1&gt; with 1&gt; [ 1&gt; VertexListGraph=boost::adjacency_list&lt;&gt;, 1&gt; Arg=const boost::detail::tarjan_scc_visitor&lt;int *,boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;,boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;,std::stack&lt;Vertex&gt;&gt;, 1&gt; T=boost::default_color_type, 1&gt; IndexMap=boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;, 1&gt; DFSVisitor=const boost::detail::tarjan_scc_visitor&lt;int *,boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;,boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;,std::stack&lt;Vertex&gt;&gt;, 1&gt; ColorMap=boost::shared_array_property_map&lt;boost::default_color_type,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;&gt; 1&gt; ] 1&gt; c:\boost_1_49_0\boost\graph\strong_components.hpp(109) : see reference to function template instantiation 'void boost::depth_first_search&lt;Graph,boost::detail::tarjan_scc_visitor&lt;ComponentMap,RootMap,DiscoverTime,Stack&gt;,boost::graph_visitor_t,boost::bgl_named_params&lt;T,Tag&gt;&gt;(const VertexListGraph &amp;,const boost::bgl_named_params&lt;boost::detail::tarjan_scc_visitor&lt;ComponentMap,RootMap,DiscoverTime,Stack&gt;,boost::graph_visitor_t,Base&gt; &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Graph=boost::adjacency_list&lt;&gt;, 1&gt; ComponentMap=int *, 1&gt; RootMap=boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;, 1&gt; DiscoverTime=boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;, 1&gt; Stack=std::stack&lt;Vertex&gt;, 1&gt; T=int, 1&gt; Tag=int, 1&gt; VertexListGraph=boost::adjacency_list&lt;&gt;, 1&gt; Base=boost::bgl_named_params&lt;int,int&gt; 1&gt; ] 1&gt; c:\boost_1_49_0\boost\graph\strong_components.hpp(152) : see reference to function template instantiation 'int boost::detail::strong_components_impl&lt;Graph,ComponentMap,RootMap,boost::iterator_property_map&lt;RandomAccessIterator,IndexMap,T,R&gt;,int,int,boost::no_property&gt;(const Graph &amp;,ComponentMap,RootMap,DiscoverTime,const boost::bgl_named_params&lt;int,Tag&gt; &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Graph=boost::adjacency_list&lt;&gt;, 1&gt; ComponentMap=int *, 1&gt; RootMap=boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;, 1&gt; RandomAccessIterator=std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;, 1&gt; IndexMap=boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;, 1&gt; T=unsigned int, 1&gt; R=unsigned int &amp;, 1&gt; DiscoverTime=boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;, 1&gt; Tag=int 1&gt; ] 1&gt; c:\boost_1_49_0\boost\graph\strong_components.hpp(165) : see reference to function template instantiation 'int boost::detail::strong_comp_dispatch2&lt;boost::detail::error_property_not_found&gt;::apply&lt;Graph,ComponentMap,RootMap,int,int,boost::no_property&gt;(const Graph &amp;,ComponentMap,RootMap,const boost::bgl_named_params&lt;T,Tag&gt; &amp;,boost::detail::error_property_not_found)' being compiled 1&gt; with 1&gt; [ 1&gt; Graph=boost::adjacency_list&lt;&gt;, 1&gt; ComponentMap=int *, 1&gt; RootMap=boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;, 1&gt; T=int, 1&gt; Tag=int 1&gt; ] 1&gt; c:\boost_1_49_0\boost\graph\strong_components.hpp(202) : see reference to function template instantiation 'int boost::detail::scc_helper2&lt;Graph,ComponentMap,boost::iterator_property_map&lt;RandomAccessIterator,IndexMap,T,R&gt;,int,int,boost::no_property,boost::detail::error_property_not_found&gt;(const Graph &amp;,ComponentMap,RootMap,const boost::bgl_named_params&lt;int,Tag&gt; &amp;,DiscoverTimeMap)' being compiled 1&gt; with 1&gt; [ 1&gt; Graph=boost::adjacency_list&lt;&gt;, 1&gt; ComponentMap=int *, 1&gt; RandomAccessIterator=std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;, 1&gt; IndexMap=boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;, 1&gt; T=unsigned int, 1&gt; R=unsigned int &amp;, 1&gt; RootMap=boost::iterator_property_map&lt;std::_Vector_iterator&lt;Vertex,std::allocator&lt;Vertex&gt;&gt;,boost::vec_adj_list_vertex_id_map&lt;boost::no_property,unsigned int&gt;,unsigned int,unsigned int &amp;&gt;, 1&gt; Tag=int, 1&gt; DiscoverTimeMap=boost::detail::error_property_not_found 1&gt; ] 1&gt; c:\boost_1_49_0\boost\graph\strong_components.hpp(215) : see reference to function template instantiation 'int boost::detail::strong_comp_dispatch1&lt;boost::detail::error_property_not_found&gt;::apply&lt;Graph,ComponentMap,int,int,boost::no_property&gt;(const Graph &amp;,ComponentMap,const boost::bgl_named_params&lt;T,Tag&gt; &amp;,boost::detail::error_property_not_found)' being compiled 1&gt; with 1&gt; [ 1&gt; Graph=boost::adjacency_list&lt;&gt;, 1&gt; ComponentMap=int *, 1&gt; T=int, 1&gt; Tag=int 1&gt; ] 1&gt; c:\boost_1_49_0\boost\graph\strong_components.hpp(230) : see reference to function template instantiation 'int boost::detail::scc_helper1&lt;Graph,ComponentMap,boost::detail::error_property_not_found,int,int,boost::no_property&gt;(const Graph &amp;,ComponentMap,const boost::bgl_named_params&lt;T,Tag&gt; &amp;,RootMap)' being compiled 1&gt; with 1&gt; [ 1&gt; Graph=boost::adjacency_list&lt;&gt;, 1&gt; ComponentMap=int *, 1&gt; T=int, 1&gt; Tag=int, 1&gt; RootMap=boost::detail::error_property_not_found 1&gt; ] 1&gt; c:\boost_1_49_0\boost\graph\strong_components.hpp(241) : see reference to function template instantiation 'int boost::strong_components&lt;Graph,ComponentMap,int,int,boost::no_property&gt;(const Graph &amp;,ComponentMap,const boost::bgl_named_params&lt;T,Tag&gt; &amp;,boost::graph::detail::no_parameter)' being compiled 1&gt; with 1&gt; [ 1&gt; Graph=boost::adjacency_list&lt;&gt;, 1&gt; ComponentMap=int *, 1&gt; T=int, 1&gt; Tag=int 1&gt; ] 1&gt; c:\boost_graph_test\test\test.cpp(13) : see reference to function template instantiation 'int boost::strong_components&lt;boost::adjacency_list&lt;&gt;,int*&gt;(const Graph &amp;,ComponentMap,boost::graph::detail::no_parameter)' being compiled 1&gt; with 1&gt; [ 1&gt; Graph=boost::adjacency_list&lt;&gt;, 1&gt; ComponentMap=int * 1&gt; ] </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6647 Trac 1.4.3 Jeremiah Willcock Fri, 02 Mar 2012 19:41:56 GMT <link>https://svn.boost.org/trac10/ticket/6647#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6647#comment:1</guid> <description> <p> This looks like a compiler bug; your test case works for me with GCC 4.6.2. I'm not sure there's much I can do about it since that <code>get</code> function should not be at all similar to the property map that the code is trying to access. Could you please try using <code>iterator_property_map</code> instead of passing a raw pointer as the component map? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 06 Mar 2012 08:37:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6647#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6647#comment:2</guid> <description> <p> i was you wondering about the fact that this code worked with boost 1.48 and VC8. passing an iterator_property_map fixed the problem. thank you for this advice. maybe it is a good idea to change the example code in graph/example/strong_components.cpp ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 12 Apr 2012 09:50:10 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6647#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6647#comment:3</guid> <description> <p> The same issue is for Visual Studio 2010. Passing iterator_property_map fixed the problem as well </p> <pre class="wiki">int num = strong_components(G, make_iterator_property_map(component.begin(), get(vertex_index, G), c[0])); </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Mon, 16 Apr 2012 17:46:18 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6647#comment:4 https://svn.boost.org/trac10/ticket/6647#comment:4 <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/78022" title="Fixed SCC example and added it to Jamfile; fixes #6647">[78022]</a>) Fixed SCC example and added it to Jamfile; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6647" title="#6647: Bugs: BGL strong_components do not compile on MSVC 8 (closed: fixed)">#6647</a> </p> Ticket