Binary of library used with different versions of ROOT

Dear ROOTers,

This is something I wanted to ask for a long time.
Binaries of my program, which consists of a libXX.so are built on the Bioconductor servers where currently
root_v5.22.00 is installed.

Users of my program can download from the servers the pre-built binaries for WinXP and MacOS X.
However the users need to install the correct root binary, currently root_v5.22.00. When they install an
older or a newer binary version from root the program will crash.

Can you tell me what is the exact reason why only the correct root version will work?

Best regards
Christian

There can be several reasons:
-different compiler versions used to compile the different releases.
-changes in ROOT API across versions. In general we try to keep the API back compatible, but simply the fact to add a new function in a class will make two versions incompatible for the linker.

Rene

The different ROOT (any evolving C++ class library for that reason) versions have the different ABI:
en.wikipedia.org/wiki/Applicatio … _interface
For some notorious platform like MS Windows the ABI of the optimized code may not match the ABI of the non-optimize code. Hence one cannot mix the optimized and non-optimized libraries of one and the same version of ROOT (what ever).
See, for example, stackoverflow.com/questions/8368 … uses-boost
techbase.kde.org/Policies/Binary … s_With_C++ etc. (google for ABI :wink: )

Dear Rene and Valeri,

Thank you for your answers.
Since I try to make sure that my program works with different root versions, and the problem appears
mainly on Windows computers, it may indeed be a problem of different ABIs.

Best regards
Christian

Hi Christian,[quote=“cstrato”]… the problem appears mainly on Windows computers… [/quote]As soon as the Windows is concern, you should be very careful.
You have to make sure that your application and ROOT libraries are compiled consistently (i.e. the same version of the ROOT/custom/system header files + the SAME compilation flags). In addition :exclamation: you have to make sure you link your application against of the correct versions of the system DLLs.
To manage :unamused: the mess MS provides the special tool called “Manifest”.
See:
http://msdn.microsoft.com/en-us/library/ms235542(VS.80).aspx

Dear Valeri,

Thank you, this means definitely that the users of my program have always to download the root binary which was used to compile my program.

Best regards
Christian

[quote=“cstrato”]Thank you, this means definitely that the users of my program have always to download the root binary which was used to compile my program.[/quote]Make sure it contains the MS CRT too from your “redist” directory:

\VC\redist\x86\Microsoft.VC90.CRT\ msvcm90.dll msvcp90.dll msvcr90.dll Microsoft.VC90.CRT.manifestSee microsoft.com/downloads/deta … laylang=en also

Dear Valeri,

Thank you, but maybe I was not quite clear: my program is not an application but a shared library, and as long as
the users download the correct root version everything is fine, no need for a manifest or CRTs.

Best regards
Christian