Boost logo

Boost Users :

From: Jun Zhang (yg-boost-users_at_[hidden])
Date: 2002-11-18 02:17:39


I am a newbie from China, I am sorry about my poor English. I encountered a
problem while using bgl.
I need your help. and I'd like to know what compiler you are using while
using bgl.

My Environment: Windows2000 + devc++4.9.6.0(it uses g++ as it's compiler)
But it can't compile and run the following example:
_________Example start____________

#include <deque> // to store the vertex ordering
#include <vector>
#include <list>
#include <iostream>

#include <boost/graph/vector_as_graph.hpp>
#include <boost/graph/topological_sort.hpp>
int main()
{
  using namespace boost;
  //create each labels of the tasks
  const char* tasks[] = {
    "pick up kids from school",
    "buy groceries (and snacks)",
    "get cash at ATM",
    "drop off kids at soccer practice",
    "cook dinner",
    "pick up kids from soccer",
    "eat dinner"};
  const int n_tasks = sizeof(tasks)/sizeof(char*);

  //create the graph
  std::vector<std::list<int> >g(n_tasks);
  g[0].push_back(3);
  g[1].push_back(3);
  g[1].push_back(4);
  g[2].push_back(1);
  g[3].push_back(5);
  g[4].push_back(6);
  g[5].push_back(6);

  // perform the toplogical sort and output the result
  std::deque<int> topo_order;
  topological_sort(g,
std::front_inserter(topo_order),vertex_index_map(identity_property_map()));
  int n = 1;
  for (std::deque<int>::iterator i = topo_order.begin();i !=
topo_order.end(); ++i, ++n)
    std::cout << tasks[*i] << std::endl;

  system("PAUSE");
}
_________Example End_____________

it says:
36 ...\main.cpp instantiated from here
I wondered it can compile another example:file_dependencies.cpp, which has
also used topological_sort.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net