|
Boost Users : |
From: James Dennett (jdennett_at_[hidden])
Date: 2007-02-11 02:42:19
Meryl Silverburgh wrote:
> Thanks. i still have problem in linking boost thread library.
>
> I have libboost_thread in /usr/lib:
>
> $ ls -la libboost_thread*
> -rwxr-xr-x 1 root root 68644 Feb 16 2006 libboost_thread.a*
> lrwxrwxrwx 1 root root 25 Jan 5 16:03 libboost_thread.so ->
> libboost_thread.so.1.33.1*
> -rwxr-xr-x 1 root root 43236 Feb 16 2006 libboost_thread.so.1.33.1*
> lrwxrwxrwx 1 root root 25 Jan 5 16:03 libboost_thread.so.2 ->
> libboost_thread.so.1.33.1*
> [meryl_at_localhost lib]$ pwd
> /usr/lib
>
> When i link it, i specified the -L and -l but I still get linker error:
>
> g++ -L/usr/lib -o"sandbox" ./thread.o -llibboost_thread
> /usr/bin/ld: cannot find -llibboost_thread
> collect2: ld returned 1 exit status
> make: *** [sandbox] Error 1
> make: Target `all' not remade because of errors.
> Build complete for project sandbox
>
> Thanks for any help.
Use -lboost_thread, not -llibboost_thread. The linker knows
that library names start with "lib", and adds it on for you,
just as it adds the extensions.
-- 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