Boost logo

Boost Users :

Subject: Re: [Boost-users] newbie: my program can't find boost libraries
From: Kraus Philipp (philipp.kraus_at_[hidden])
Date: 2012-03-31 05:17:18

Am 31.03.2012 um 02:16 schrieb Lars Viklund:

> On Sat, Mar 31, 2012 at 02:10:41AM +0200, Philipp Kraus wrote:
>> On 2012-03-31 00:09:59 +0200, sparsh mittal said:
>>> In my RHEL linux (no root permission), my program does not find boost
>>> installation and says:
>>> *** Please install package libboost-filesystem to /home/myself/folder
>>> *** Please install package libboost-system to /home/myself/folder
>>> I installed latest boost using these instructions.
>>> ./ ----with-libraries=filesystem,system
>>> --prefix=/home/myself/folder
>>> ./bjam install
>>> Can you tell, what is wrong I am doing and anything to add in include path etc.
>>> My paths:
>>> /home/myself/folder/lib:/home/myself/ddrive/test/boost_1_49_0/stage/lib
>>> /home/myself/folder/include/
>>> My program has makefile:
>>> LD_LIBS += -lboost_filesystem -lboost_system (and others)
>> LD_LIBRARY_PATH is the env variable for the linker, you must also set the
>> LIBRARY_PATH for running a programm. A program searches the LIBRARY_PATH
>> first for the libraries. The linker does not search the LIBRARY_PATH, it
>> uses the
> Not quite.
> The regular linker doesn't look anywhere indicated by an environment
> variable. It just looks in the system locations and wherever specified
> with a -L flag when linking.
> His error seems to be from some build system, not his compiled program.
> He needs to provide parameters like "-L/home/myself/folder/lib" to it,
> typically in the form of LDFLAGS or similarly named parameters.
> LD_LIBRARY_PATH is for the dynamic linker to resolve shared libraries at
> runtime, it has no role at linking time.

Your right, I have set in build toolset (Scons) both types LD_LIBRARY_PATH and LIBRARY_PATH
to equal values and my Scons script should read the path values of the variables and set the -L
parameter on the g++ calls. In my case I can add a new directory to the linker and run command
if I set only one of the variables to the path.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at