Boost logo

Boost Users :

From: James Dennett (jdennett_at_[hidden])
Date: 2007-02-04 16:11:03


Meryl Silverburgh wrote:
>
> On 2/4/07, John Maddock <john_at_[hidden]> wrote:
>> Meryl Silverburgh wrote:
>>> i have more information about my problem:
>>>
>>> I have add '-L/usr/lib' as my library path during linking and i make
>>> sure i have 'libboost_thread*' library in '/usr/lib', but it still
>>> does not work. Any idea why?
>> This is a compiler issue: you need to tell the compiler that you need to
>> link to the thread lib with a -lboost_thread.
>>
>> John.
>
> Thanks but if I specified '-L/usr/lib', won't it links all libraries
> under '/usr/lib' which includes 'boost_thread'?
>
> Thank you.

No, that's not how linkers work. The notion of the
search path (specified by -L) is separate from the
choice of which libraries to search for. C++ does
not have a fixed association from a particular header
to a fixed library name (unless you use platform-
specific extensions) -- you can specify the same
search path, and still fulfill linkage requirements
in many different ways by specifying different library
names.

In summary: -L says where to look for named libraries,
and -l says which named libraries to look for.

-- James


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