Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add compiler include paths and linker library paths for newly installed Boost?

I have RHEL 5.2, with Boost 1.33 installed. I downloaded boost_1_44_0.tar.bz2. and built it. On completion it showed:

The Boost C++ Libraries were successfully built!  The following directory should be added to compiler include paths:      /home/dfe/Archive/boost_1_44_0  The following directory should be added to linker library paths:      /home/dfe/Archive/boost_1_44_0/stage/lib 
  1. How do I add the above mentioned include paths?
  2. When I do "rpm -q boost", it shows boost-1.33.1-10.el5. Why is that so, when I've installed version 1.44?
  3. Is there a better way to install the latest version of Boost?
like image 943
Nav Avatar asked Nov 08 '10 12:11

Nav


People also ask

How do I add boost to path?

Go to Project properties → C/C++ → General → Additional Include Directories, and add a path to the boost library root (in my case C:\Program Files (x86)\Boost_1_53 ). Include a . hpp file in your sources, like #include <boost/lexical_cast/lexical_cast_old.


2 Answers

There are always three steps to install software on Linux systems:

  1. configure — "check"
  2. make — "build software in current directory"
  3. make install — "copy files to the systems so the other software can use this software"

You likely did the equivalent of make but did not do the equivalent of make install. You need to run

sudo ./b2 install 

after running ./b2

like image 74
user2716834 Avatar answered Oct 07 '22 10:10

user2716834


Just add the paths to your .bashrc or .profile (or whatever floats your boat) like this:

export LIBS="-L/home/dfe/Archive/boost_1_44_0/stage/lib" export CPPFLAGS="-I/home/dfe/Archive/boost_1_44_0" 
like image 24
der_michael Avatar answered Oct 07 '22 11:10

der_michael