# Rootrc load with different version

**URL:** <https://root-forum.cern.ch/t/rootrc-load-with-different-version/36135>\
**Category:** ROOT\
**Created:** [September 24, 2019, 9:09am UTC](https://root-forum.cern.ch/t/rootrc-load-with-different-version/36135 "2019-09-24T09:09:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cxwx](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/cxwx/32/22075_2.png) [@cxwx](https://root-forum.cern.ch/u/cxwx)\
**Post date:** [September 24, 2019, 9:09am UTC](https://root-forum.cern.ch/t/rootrc-load-with-different-version/36135/1 "2019-09-24T09:09:34Z")

</div>

* * *

ROOT Version:6 and 5

* * *

I have root with version 5 and 6. root5 for some old file

and how to I set rootrc5 and rootrc6 when I use different version of root

or set  
rootlogon5.cpp when using root5.

is there an Macro definition in c code like below?  
#ifdef ROOT5\_USED  
void rootlogon(){}  
#else  
void rootlogon(){}  
#endif

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [September 24, 2019, 9:19am UTC](https://root-forum.cern.ch/t/rootrc-load-with-different-version/36135/2 "2019-09-24T09:19:17Z")

</div>

> [@Hiding ROOT::Cintex::Cintex::Enable(); from ROOT6 compilation in a backwards compatible way](https://root-forum.cern.ch/t/hiding-root-enable-from-root6-compilation-in-a-backwards-compatible-way/35134/4):
>
> Try to “#include” anything from ROOT and then (if ROOT 5 will misbehave, replace ROOT\_VERSION(6,00,00) with 393216): #if ROOT\_VERSION\_CODE \>= ROOT\_VERSION(6,00,00) // ... ROOT 6.00/00 and newer #else /\* ROOT\_VERSION\_CODE \>= ROOT\_VERSION(6,00,00) \*/ // ... ROOT 5 (and older) #endif /\* ROOT\_VERSION\_CODE \>= ROOT\_VERSION(6,00,00) \*/ See also:

> [@Legendre polynomials missing, not linking to GSL (Mathmore already installed)](https://root-forum.cern.ch/t/legendre-polynomials-missing-not-linking-to-gsl-mathmore-already-installed/34879/6):
>
> If you run your macros through the standard “root” (or “root.exe”) executable, try to create a “rootlogon.C” file: void rootlogon(void) { // rootlogon.C ... // std::cout \<\< "... rootlogon.C ..." \<\< std::endl; if (gROOT-\>GetVersionCode() \< 393216) { // 393216 = ROOT\_VERSION(6,00,00) gSystem-\>Load("libMathMore"); } } // ... rootlogon.C

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [October 8, 2019, 9:19am UTC](https://root-forum.cern.ch/t/rootrc-load-with-different-version/36135/3 "2019-10-08T09:19:25Z")

</div>

Closed on October 8, 2019, 9:19am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
