Boost graph library c++

Hi all,

I am working on boost graph library but I could not get it worked. I found an example code and opened it. However, there is also some .hpp files to add and I get errors regarding this:

cannot open source file "boost/config.hpp"
cannot open source file "boost/graph/adjacency_list.hpp"

What should I do to fix this? I can't figure out how to add them to my code.

There shouldn't be a reason to "add" any header files, at least not individually.
Install boost, add the path to the top-level include directory (the one that holds the directory just called "boost") to your include path, and compile.
Last edited on
I installed it and ran the following code that I got from their website: libs/graph/example/dijkstra-example.cpp

But I still get the same error. Should I do something else after installing? Thanks
The procedure for library install depends on what kind of development environment you're using.

For example, on a typical Linux installation, it compiles and runs this way:

~ $ g++ -o test dijkstra-example.cpp
~ $ ./test
distances and parents:
distance(A) = 0, parent(A) = A
distance(B) = 6, parent(B) = E
distance(C) = 1, parent(C) = A
distance(D) = 4, parent(D) = C
distance(E) = 5, parent(E) = D
Topic archived. No new replies allowed.