Search This Blog

Friday, May 20, 2011

Build Your Own Boost Library (with 3 commands)

  • Go to and download the latest stable source. 
  • tar xvf your-boost.tar
  • ./ --prefix=path/to/installation/prefix
  • ./bjam install

When you compile your boost program, specify your include path (for headers), binary path (to link the binary), and get your environment variable LD_LIBRARY_PATH set up so you can run your program after compiling, for example:
  -I /your/boost/include/folder/path/include
  export LD_LIBRARY_PATH=/your/path/to/boost/lib/

example, let's use libboost_filesystem:
  g++ -I/your/include  -L/your/lib/ -lboost_filesystem

No comments: