Search code examples
c++linuxboostbjam

Boost, bjam, and symbolic links


I generated some Boost librairies with bjam, and I get many symbolic links.

For date_time :

libboost_date_time-gcc41-mt-1_39.a

libboost_date_time-gcc41-mt-1_39.so -> libboost_date_time-gcc41-mt-1_39.so.1.39.0

libboost_date_time-gcc41-mt-1_39.so.1.39.0

libboost_date_time-gcc41-mt.a -> libboost_date_time-gcc41-mt-1_39.a

libboost_date_time-gcc41-mt.so -> libboost_date_time-gcc41-mt-1_39.so.1.39.0

Why don't I just get the .a and .so ? Why these 3 symbolic links ? And why do the original files have a so complicated name for the .so, with the release version mentionned twice ?

Isn't it possible to just have :

libboost_date_time-gcc41-mt-1_39.a libboost_date_time-gcc41-mt-1_39.so

Thanks for help. I don't know what to do of these symbolic links.

Note : I am a newbie in Linux.


Solution

  • A symbolic link is a way of sharing the same file between two names. For example if A is linked to B then opening A or B will give the same data to the calling program.

    In this case you have 2 files libboost_date_time-gcc41-mt-1_39.so.1.39.0 and libboost_date_time-gcc41-mt-1_39.a. The .so files are shared libraries and .a are static libraries.

    The links without version numbers libboost_date_time-gcc41-mt.so and libboost_date_time-gcc41-mt.a are there so that builds that do not care about the version number can use these libraries.

    For shared libraries there is a naming convention with version numbers so that the full version number is at the end so the build system can have exact control of the version number.

    see Boost docs for full explanation