Boost logo

Boost Users :

From: Rupert Bruce (rupert_at_[hidden])
Date: 2008-05-23 18:14:25


Longyu Mei wrote:
> After I built boost in Linux, I found in the lib
> directory there are three files for each package. For
> example, for system, files are
>
> libboost_system-gcc41-mt-1_35.so
> libboost_system-gcc41-mt-1_35.so.1.35.0
> libboost_system-gcc41-mt.so
>
>
> Why is that? Only one file is needed in my link flag?
> which one?
>
They are typically linked to each other (there is only one 'real' file -
the others are pointers with different names.
listing with 'ls -l' shows more detail:
lrwxrwxrwx 1 root root 25 2008-02-24 17:06 libboost_thread.so ->
libboost_thread.so.1.33.1
-rwxr-xr-x 1 root root 45508 2008-01-17 11:02 libboost_thread.so.1.33.1
lrwxrwxrwx 1 root root 25 2008-02-24 17:03 libboost_thread.so.2 ->
libboost_thread.so.1.33.1

This allows you to include the libboost_thread.so file in your build and
when you upgrade to a new version, the specific version of the file does
not need to be changed in your build file (ie. you can keep referring to
libboost_thread.so even though it may now link to libboost_thread.so.1.34.1)

Another point you might not be aware of is that when you link to a
library file, depending on the platform, there may be some prefix or
suffix added by the compiler - specifically, on linux, the "lib" is
prefixed and ".so" suffixed so you would include the following in your
build file:
    -l boost_system-gcc41-mt
(I confess that since I don't have the "-gcc41-mt" part in my build,
I've assumed that is necessary)

In my Makefile, I have "-l boost_thread" which the linker translates
into libboost_thread.so which in turn is linked by the OS to
libboost_thread.so.1.33.1

> thanks,
> James
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>


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