Boost logo

Boost Users :

From: Paul Giaccone (paulg_at_[hidden])
Date: 2005-11-28 04:30:51


Ace Bluedust wrote:

> Hi, I would like to know if someone could show me how to compile and
> build with
> a conventional Makefile (linux-gnu-gcc) for the BOOST GRAPH LIBRARY.
> I'm not
> sure of which lib files to link and what are the needed flags. I have
> to do by
> Makefile because I also use another library other than BOOST.

Here's a summary of what I have done for my Linux builds. I'm assuming
you define the following variables in your makefile:

BOOSTDIR (path to where you have installed Boost)
INCLPATH (include path)
LFLAGS (link flags)
LIBS (additional libraries used to link the program)

Then:

* Build the Boost graph library according to the Boost documentation, if
you haven't already done so.
* In INCLPATH, put

    -isystem $(BOOSTDIR)/include/boost-<BOOSTVERSION>

  replacing <BOOSTVERSION> with the version of Boost you are using (eg,
1_33)

* In LFLAGS, put

    -L $(BOOSTDIR)/lib

  so the linker can locate the Boost libraries

* In LIBS, put

    -l<library_name>

  replacing <library_name> with the version of the graph library
(debug/release build? single-/multi-threaded?) that you need from
$(BOOSTDIR)/lib

That should be it. It's no different from linking against any other
library really.

Paul


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