Boost logo

Boost :

From: John Britton (johnb_at_[hidden])
Date: 2000-10-30 17:36:15

I was hoping that version 1.18.1 would magically make my problem with VC++
and connected_components go away, but alas, it does not.

If I create an empty console application project, and then add a file
containing the enclosed source code to it, making no changes to the project
settings (other than to set the additional include directories to point to
boost), compiling the file for Win32 Debug causes a VC++ internal compiler
error (noted below). Compiling for Win32 Release does not excite the error.

I don't think the problem is as simple as the difference between debug and
release - in the past I was able to "fix" the problem in the debug version
of my code by doing such things as: moving code blocks around, going from
multi-threaded to single-threaded, and even by enclosing some of the code
with #if 1 / #endif !

John Britton
Very Important Engineer++
Peak Audio Inc.
1790 30th Street, Suite 414
Boulder, CO 80301
303.449.9337 x102

Code demonstrating a VC++ compiler problem

: fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line

#pragma warning (disable: 4786)
#include <utility>
#include <vector>

#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/connected_components.hpp>

typedef std::pair<int, int> edge_t;
typedef std::vector< edge_t > edge_list_t;

size_t check_components( int num_vertices, edge_list_t& the_edges ) {
  // create a graph based on the_edges
  typedef boost::adjacency_list<
    boost::vecS, boost::vecS, boost::undirectedS, boost::property<
      boost::vertex_discover_time_t, int, boost::property<
        boost::vertex_finish_time_t, int, boost::property<
          boost::vertex_color_t, boost::default_color_type > > > > graph_t;
  graph_t G( num_vertices, the_edges.begin(), the_edges.end() );
  // result data: component ID for each vertex
  std::vector<int> c( boost::num_vertices(G) );
  // run the algorithm
  int num = boost::connected_components(
    G, &c[0], boost::get( boost::vertex_color, G ), boost::dfs_visitor<>()
  return num;

Boost list run by bdawes at, gregod at, cpdaniel at, john at