
Meryl Silverburgh wrote:
On 2/4/07, John Maddock
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
Meryl Silverburgh wrote: 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