Question

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.

Was it helpful?

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

OTHER TIPS

I dont know anything specific to boost or bjam.

But the last two, if you see are version independent. So any consumer of this .so or .a file could just use the base name for their purposes. In case, any newer version of those libaries are available, one could put it there and just modify the sym links to point to new version. In this way, they can have both versions in place, so that if any one wants to use the particular version they could use it directly without sym links. And people who dont care about version can use the base name itself to get the latest version!

I think this way is used if you install different versions of java in a unix machine. Atleast, i remember seeing it in my Ubuntu. We have separate folders for each version/update of java. And you have the another folder sym link which always points to latest jre version folder. This can also be seen if you install different version gcc over an existing version (especially rpm packages in linux)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top