Search This Blog

Friday, May 20, 2011

Build Your Own Boost Library (with 3 commands)

  • Go to boost.org and download the latest stable source. 
  • tar xvf your-boost.tar
  • ./bootstrap.sh --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
  -L/home/bps-linux/bin/boost146/lib/
  export LD_LIBRARY_PATH=/your/path/to/boost/lib/

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

No comments: