Forced linking

Say I have a project that links with a shared object, This file is a link to The resulting executable will NEED at run time.

In 3 years from now I need to rebuild the same executable but in the mean time got updated to Naturaly on my development machine has become a link to How can I make sure that I can rebuild the same executable against and NOT ( .5 ). I try to force the build to use but no luck so far.

  • Mario


one possibility I see is adding a symlink (e.g. referencing to your development machines lib directory.

In your application you can add foo.1 (instead of foo) as extra library. But maybe you don’t want to change your lib dir?

(I expect further problems as the old foo library might use other, out of date libs…)


I think I figure out a way. I will put and in the libfoo_v1 directory and point the makefile to it. When v2 gets created I’ll have both file in libfoo_v2. The makefile will have the lib search path set to the proper library.

Thanks for the suggestion.

But what happens, if in 3 years the current points to while the requires I guess, your application will load AND in this case. I doubt that this healthy…

In my eyes, version conflicts and the resulting dependency issues are one of the major (unsolved) problems in todays software industries.

  • Peter

Good point, in fact I don’t know. The easy solution would be to use a static library but it makes a 300K executable grow to 1.2M…

I think I can get around this issue because our software the OS, and external library are always bundle together. Hence in 3 years if we upgrade the software and are using a different version of the OS we would have to upgrade everything.

It seems to me we need a solution to force linking with a perticular version of a shared library.


Of course you see where this is going <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) -->.   Eventually, you will have to create a separate VM for every project, and even every version of every project.   With terabyte hard drives finally out, this should be no problem.

The best would be to draw a copy from the present and load it in The Matix if required. (you know the movie?)

If ever possible, newer versions of a libraries should always be backward compatible with older versions. If this is true, there is nothing wrong with linking the old application with a newer version of If not, somebody has broken the interface (and should get punished for doing this :wink:).

  • Peter