Linux beginner, Where to put boost libraries?

I am not very familiar with the Linux file system by going from windows, but I have decent experience with C ++ and Boost libraries on Windows. By switching Fedora 17, can someone tell me if there is a specific directory where I have to install Boost in order to make it work with the gnu compiler?

Note: if that matters, I don't use an IDE, I use vim for most of my programming.

+7
source share
4 answers

Use the package manager to install accelerated libraries for debian ubuntu:

sudo aptitude install libboost-system1.49.0-dev 

for centos6 this

 yum install boost-devel 
+9
source

There are several ways to configure boost libraries in linux.

  • Save yourself the pain, use the package manager to install Boost libs. You will be grateful in the end.

  • If you absolutely must do it yourself, just put it anywhere while it is in the path of enabling gcc. These are /usr/local/include/ or /usr/include/ for headers and /usr/local/lib/ or /usr/lib/ for libraries

  • Finally, if for some reason this is not possible, use the -I switch with g ++ to indicate the path to force. (but this would be necessary only if 1 and 2 are impossible)

+13
source

I had problems installing boost with yum (recently installed Fedora 17). so I unzipped the fortune ball for my / opt.

therefore g++ -I /opt/boost/boost_1_51_0 works like a charm.

+1
source

From introduction to boost:

http://www.boost.org/doc/libs/1_51_0/more/getting_started/unix-variants.html

you can put it anywhere. And then you compile something like this

 c++ -I path/to/boost_1_51_0 example.cpp -o example \ -L~/boost/stage/lib/ -lboost_regex-gcc34-mt-d-1_36 

" c++ " can be g++ or clang++ , for example.

0
source

All Articles