Boost logo

Boost Users :

Subject: Re: [Boost-users] newbie: my program can't find boost libraries
From: Lars Viklund (zao_at_[hidden])
Date: 2012-03-30 20:16:06


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.
>>
>> ./bootstrap.sh ----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:
>>
>> echo $LD_LIBRARY_PATH
>> /home/myself/folder/lib:/home/myself/ddrive/test/boost_1_49_0/stage/lib
>>
>> echo $CPLUS_INCLUDE_PATH
>> /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
> LD_LIBRARY_PATH

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.

-- 
Lars Viklund | zao_at_[hidden]

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net